"", 'load_AddSticky_in' => 'footer' ); function __construct() { $this->url_path = WP_PLUGIN_URL . "/" . plugin_basename( dirname( __FILE__ ) ); if( isset( $_SERVER['HTTPS'] ) ) { if( (boolean) $_SERVER['HTTPS'] === true ) { $this->url_path = str_replace( 'http://', 'https://', $this->url_path ); } } $this->option_name = '_' . $this->namespace . '--options'; add_action( 'admin_menu', array( &$this, 'admin_menu' ) ); if( is_admin() ) { wp_register_style( $this->namespace, $this->url_path . '/' . $this->namespace . '.css', array(), $this->version ); wp_enqueue_style( $this->namespace ); wp_register_script( $this->namespace, $this->url_path . '/' . $this->namespace . '.js', array( 'jquery' ), $this->version ); wp_enqueue_script( $this->namespace ); } else { if( $this->get_option( 'load_AddSticky_in' ) == 'header' ){ add_action( 'wp_head', array( &$this, 'AddSticky_print_script' ) ); } else { if( function_exists( 'wp_print_footer_scripts' ) ) { add_action( 'wp_print_footer_scripts', array( &$this, 'AddSticky_print_script' ) ); } else { add_action( 'wp_footer', array( &$this, 'AddSticky_print_script' ) ); } } } } function AddSticky_print_script () { $AddSticky_code = $this->get_option( 'AddSticky_code' ); if( !empty( $AddSticky_code ) ) { $AddSticky_code = html_entity_decode( $AddSticky_code, ENT_QUOTES); if( $this->get_option( 'load_AddSticky_in' ) == 'header' ) { $output = preg_replace( "/