Tag Info

New answers tagged

0

This seems to work: function agr_wp_install($user){ ... } add_action('wp_install', 'agr_wp_install', 1);


1

The main component you are probably missing is dropping your customizations in an install.php file in the wp-content directory. If you look at the /wp-admin/includes/upgrade.php you will be able to see exactly how it is included and the installation functions you can override. I am not sure if that will be good enough to catch the hook you want to use but ...


0

WordPress' installation file defines a constant called WP_INSTALLING 27 /** 28 * We are installing WordPress. 29 * 30 * @since 1.5.1 31 * @var bool 32 */ 33 define( 'WP_INSTALLING', true ); https://core.trac.wordpress.org/browser/tags/4.1.1/src/wp-admin/install.php#L33 Given that, I think you could hook to an action like ...


1

The publish_{post-type} action is triggered only when the post change from any post status (not published) to published; for example, if the post is already published and you edit it, the publish_{post-type} action is not triggered. I think you need to hook your function to save_post_{post_type} action, which is triggered every time a post is saved, not ...


-3

You could just do a display:none on the css selector for the slug so they never see it.


2

The thing with class methods is that unless they're static, they belong to an object. And in your case your object is: new WC_Admin_Taxonomies_new(); Which means PHP will create the object and keep it in memory. But unfortunately, since you're not assigning this object to a variable, you have no way of referencing it later in your code. Off the top of my ...


1

Just match the callback in your remove call - array( CLASSNAME, METHOD ): remove_action( 'user_register', array( 'Groups_Registered', 'user_register' ) );


1

You need to insert your term after the init hook (i.e. when the taxonomy is registered): function create_tax() { $args = array(...); register_taxonomy('custom_tax', array('post'), $args); // Now we're safe $result = wp_insert_term('Test Term', 'custom_tax', array('parent'=>0) ); }


0

The problem is the initialization in WordPress via register_activation_hook( __FILE__, 'activate_IWCollege_Courses' ); The function was fired on the Activation of a plugin, not more. You must switch to the hook init. For Custom Post types is the init hook the recommendation of the codex. But the important part flush_rewrite_rules();in your activation ...


1

Use update_post_meta(), because if the meta key already exists add_post_meta() will do nothing if $unique is true and otherwise won't update neither, while update_post_meta(), well, it will update the value of a existing field or create it, if it doesn't exist yet.



Top 50 recent answers are included