problem with register_activation_hook in plugin
register_activation_hook only fires when plugin is going to active. You should use your function in add_action(‘admin_init’,’your_function_name’).
register_activation_hook only fires when plugin is going to active. You should use your function in add_action(‘admin_init’,’your_function_name’).
simplest solution – set the post_author to an admin or editor user. The reason “id” and other attributes and tags are stripped from the content is to prevent unauthorized users to inject content which might be used to “still” the credentials of other users. Right now you don’t explicitly set the user to which the … Read more
If you want to specifically deny a capability from a user (not a role), you need to use the add_cap() method and specify that the $grant parameter is false. $user = new WP_User( ‘Y’ ); $user->add_cap( ‘edit_plugins’, false );
I think what you are asking is changing the text +NEW to ADD Deal. This code is adjusted like that. add_action( ‘admin_bar_menu’, ‘change_new_post_name’, 999 ); function change_new_post_name ( $wp_admin_bar ) { //Removing +New $wp_admin_bar->remove_node( ‘new-content’ ); //hyperlink for the new link. This can be anything. Currently it’s default. $link = get_bloginfo(‘url’).’/wp-admin/post-new.php’; //Parameters to create a … Read more
Here are two options for you: 1) Do you have access to the WordPress database via PhpMyAdmin or similar? If so, you can change the information via the wp_options table in siteurl and home (inside the option_name column). Change both those and you should be good to go. WARNING! If you make the change in … Read more
You should add the following to your functions.php, you can add, edit or delete items to your desire. remove_action( ‘admin_bar_menu’, ‘wp_admin_bar_wp_menu’, 10 ); add_action( ‘admin_bar_menu’, ‘my_admin_bar_wp_menu’, 10 ); function my_admin_bar_wp_menu( $wp_admin_bar ) { $wp_admin_bar->add_menu( array( ‘id’ => ‘wp-logo’, ‘title’ => ‘<span class=”ab-icon”></span>’, ‘href’ => ‘http://yourdomain.com’, ‘meta’ => array( ‘title’ => __(‘About my website’), ), ) … Read more
Even if admin-ajax.php and Ajax API were created to be used in ajax requests, they can be used in normal http requests with no issues, just be aware that is_admin() will be true even if user is not logged and the request is done from frontend. What you have to do is create a callback … Read more
This is not your code I suspect, as there are really many errors in your code. I’m going to list them Firstly, you are registering your custom post type inside a function that you hook to init, which is fine. Then you register your taxonomies outside that function. What the reason bhin that is, I … Read more
Well… WordPress uses the wpeditimage tinymce plugin to perform the tasks for the “Add Media” editor button. When you click the pencil icon to edit the image… the wpeditimage plugin will read the image code, and determine if there is a value of _blank for the target attribute. If the value is _blank; the plugin … Read more
I am not sure I completely follow your second example. You can use get_edit_post_link() template tag, which will output the link to admin side for the current post (only for users who can edit the post). If you just want pretty link for that there is no native way, but it looks similar to what … Read more