Manipulate theme version – hook into wp_get_theme()
Manipulate theme version – hook into wp_get_theme()
Manipulate theme version – hook into wp_get_theme()
Your problem is that if you want to switch theme you have to do it very early, in fqact, the latest action you can hook for that task is setup_theme that is fired before the theme is actually loaded, so – first of all – if you want to change the theme you should use … Read more
Use get_file_data( $file, $headers ): $file_data = get_file_data( __FILE__, array ( ‘Plugin Name’ ) ); echo “the name is ” . $file_data[0]; Make sure the first parameter points to an existing file. It will find all lines that are formatted like regular plugins headers or the headers of a style.css. In my plugin T5 Opera … Read more
Do not use just the header string, call display() instead and set the second parameter to FALSE to suppress markup. // FALSE for no markup $theme->display( ‘Author’, FALSE ); What you see in your var_dump() are private properties. If you print $theme->Author the magic __get() method is called and this calls display() without the second … Read more
In the WP_Theme class, the get method gives you a sanitized theme header. You cannot use it to extract a property. Actually you don’t need to, as you can access it directly like this: // get the parent object $parent = wp_get_theme()->parent(); // get parent version if (!empty($parent)) $parent_version = $parent->Version;
Thanks for all the help which pointed me in the right direction. In the end I used the following: $style_parent_theme = wp_get_theme(get_template()); $style_parent_theme_author = $style_parent_theme->get( ‘Author’ ); I use get_template() to recover the folder name of the parent theme. wp_get_theme then get’s the theme object. Once we have that we can manipulate the object to … Read more
In order to do what you want , you can add whatever fields you want, and then store them in the user_meta … (One could also store them in the $user_info array/object, but I am not sure what would be the benefit .. ) // Render Form Fields add_action(‘register_form’,’k99_register_form_add_theme_field’); // Checking add_action(‘register_post’,’k99_check_fields’,10,3); // Insert Data … Read more