__construct();} /** * PHP 5 Constructor */ function __construct(){ //Language Setup $locale = get_locale(); $mo = dirname(__FILE__) . "/languages/" . $this->localizationName . "-".$locale.".mo"; load_textdomain($this->localizationDomain, $mo); //"Constants" setup $thispluginurl = PLUGIN_URL . dirname(plugin_basename(__FILE__)).'/'; $thispluginpath = PLUGIN_PATH . dirname(plugin_basename(__FILE__)).'/'; //Initialize the options //This is REQUIRED to initialize the options when the plugin is loaded! $this->getOptions(); //Actions add_action("admin_menu", array(&$this,"admin_menu_link")); //Widget Registration Actions add_action('plugins_loaded', 'register_widgets'); /* add_action("wp_head", array(&$this,"add_css")); add_action('wp_print_scripts', array(&$this, 'add_js')); */ //Filters /* add_filter('the_content', array(&$this, 'filter_content'), 0); */ } /** * Retrieves the plugin options from the database. * @return array */ function getOptions() { //Don't forget to set up the default options if (!$theOptions = get_option($this->optionsName)) { $theOptions = array('default'=>'options'); update_option($this->optionsName, $theOptions); } $this->options = $theOptions; //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //There is no return here, because you should use the $this->options variable!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } /** * Saves the admin options to the database. */ function saveAdminOptions(){ update_option($this->optionsName, $this->options); } /** * @desc Adds the options subpanel */ function admin_menu_link() { //If you change this from add_options_page, MAKE SURE you change the filter_plugin_actions function to //reflect the page filename (ie - options-general.php) of the page your plugin is under! add_options_page('{Full Plugin Name}', '{Full Plugin Name}', 10, basename(__FILE__), 'admin_options_page'); add_filter( 'plugin_action_links', array(&$this, 'filter_plugin_actions'), 10, 2 ); } /** * @desc Adds the Settings link to the plugin activate/deactivate page */ function filter_plugin_actions($links, $file) { static $this_plugin; if( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__); if( $file == $this_plugin ){ //If your plugin is under a different top-level menu than Settiongs (IE - you changed the function above to something other than add_options_page) //Then you're going to want to change options-general.php below to the name of your top-level page $settings_link = '' . __('Settings') . ''; array_unshift( $links, $settings_link ); // before other links } return $links; } /** * Adds settings/options page */ function admin_options_page() { if($_POST['{plugin_slug}_save']){ $this->options['{plugin_slug}_path'] = $_POST['{plugin_slug}_path']; $this->options['{plugin_slug}_allowed_groups'] = $_POST['{plugin_slug}_allowed_groups']; $this->options['{plugin_slug}_enabled'] = ($_POST['{plugin_slug}_enabled']=='on')?true:false; $this->saveAdminOptions(); echo '

Success! Your changes were sucessfully saved!

'; } ?>

{Full Plugin Name}

options['title'] . $after_title; echo ''; echo $after_widget; } function {widget_slug}_control() { if ( $_POST["{plugin_slug}_{widget_slug}_submit"] ) { $this->options['{plugin_slug}-comments-title'] = stripslashes($_POST["{plugin_slug}-comments-title"]); $this->options['{plugin_slug}-comments-template'] = stripslashes($_POST["{plugin_slug}-comments-template"]); $this->options['{plugin_slug}-hide-admin-comments'] = ($_POST["{plugin_slug}-hide-admin-comments"]=='on'?'':'1'); $this->saveAdminOptions(); } $title = htmlspecialchars($options['{plugin_slug}-comments-title'], ENT_QUOTES); $template = htmlspecialchars($options['{plugin_slug}-comments-template'], ENT_QUOTES); $hide_admin_comments = $options['{plugin_slug}-hide-admin-comments']; ?>

localizationDomain); ?> localizationDomain); ?>

/>

'{widget_slug}', 'description' => __( 'Widget Description', $this->localizationDomain ) ); wp_register_sidebar_widget('{plugin_slug}-{widget_slug}', __('Widget Title', $this->localizationDomain), array($this, 'display_{widget_slug}'), $widget_ops); wp_register_widget_control('{plugin_slug}-{widget_slug}', __('Widget Title', $this->localizationDomain), array($this, '{widget_slug}_control')); } } } //End Class } //End if class exists statement //instantiate the class if (class_exists('{plugin_slug}')) { ${plugin_slug}_var = new {plugin_slug}(); } ?>
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.