Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( !class_exists( 'ubam_oto' ) ) {
- class ubam_oto
- {
- var $optionsName = 'ubam_oto_options';
- var $localizationDomain = "ubam_oto";
- var $thispluginurl = '';
- var $thispluginpath = '';
- var $options = array( );
- function ubam_oto( )
- {
- $locale = get_locale();
- $mo = dirname( __FILE__ ) . "/languages/" . $this->localizationDomain . "-" . $locale . ".mo";
- load_textdomain( $this->localizationDomain, $mo );
- $this->thispluginurl = PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) . '/';
- $this->thispluginpath = PLUGIN_PATH . '/' . dirname( plugin_basename( __FILE__ ) ) . '/';
- $this->getOptions();
- add_action( "admin_menu", array(
- &$this,
- "admin_menu_link"
- ) );
- add_action( "init", array(
- &$this,
- "ubam_oto_handler"
- ) );
- }
- function getOptions( )
- {
- if ( !$theOptions = get_option( $this->optionsName ) ) {
- $theOptions = array(
- 'default' => 'options'
- );
- update_option( $this->optionsName, $theOptions );
- }
- $this->options = $theOptions;
- }
- function saveAdminOptions( )
- {
- return update_option( $this->optionsName, $this->options );
- }
- function admin_menu_link( )
- {
- add_options_page( 'One-Time Offer', 'One-Time Offer', 'manage_options', 'one-time-offer.php', array(
- &$this,
- 'admin_options_page'
- ) );
- add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array(
- &$this,
- 'filter_plugin_actions'
- ), 10, 2 );
- }
- function filter_plugin_actions( $links, $file )
- {
- $settings_link = '<a href="options-general.php?page=' . basename( __FILE__ ) . '">' . __( 'Settings' ) . '</a>';
- array_unshift( $links, $settings_link );
- return $links;
- }
- .............................................................
- ..................................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement