Tag Info

Hot answers tagged

4

Wait for the action plugins_loaded before you create the class instance. The pluggable functions are loaded at this time. From wp-settings.php: /** * Fires once activated plugins have loaded. * * Pluggable functions are also available at this point in the loading order. * * @since 1.5.0 */ do_action( 'plugins_loaded' ); I would even wait for ...


2

You have misspelled the action hook name. This: add_action( 'after-setup_theme', 'ja_theme_setup' ); Should be: add_action( 'after_setup_theme', 'ja_theme_setup' ); The full code: add_action( 'after_setup_theme', 'ja_theme_setup' ); function ja_theme_setup() { add_theme_support( 'post-thumbnails'); }


1

The simplest and quickest solution would be to use the add_rewrite_endpoint function. <?php add_rewrite_endpoint( $name, $places ); ?> So in your case it would be something like this: add_rewrite_endpoint( 'user', EP_PERMALINK | EP_PAGES ); An user URL would look like this: http://www.example.com/my-page/user/john To access the variable: ...


1

You are saving data to an option named my_option_name so your attempt to retrieve data from an option named $this->options['title'] isn't going to work. You will need something like this: public function DataToget($field = '') { if (empty($field)) return; $jugHigh = get_option( 'my_option_name' ); if (!isset($jugHigh[$field])) return; return ...



Only top voted, non community-wiki answers of a minimum length are eligible