Add role privileges of the custom post type
Add role privileges of the custom post type
Add role privileges of the custom post type
Add Inline Styles In WP Dashboard
the system was apparently, recently updated from a very old version of WP core. there was a customization around taxonomy suppression and the pre_get_posts hook which didn’t also consider is_admin()
After did many trials and errors, finally I found the answer. Just in case anyone wondering how this working, I put the full code right here : /* == THEME OPTIONS == */ add_action(“admin_menu”, “setup_theme_admin_menus”); function setup_theme_admin_menus() { add_submenu_page(‘themes.php’, ‘Generate Coupons’, ‘Generate Coupons’, ‘manage_options’, ‘generate-coupons-elements’, ‘theme_generate_coupons_settings’); } function theme_generate_coupons_settings() { ?> <div class=”wrap”> <?php screen_icon(‘themes’); … Read more
This was actually a bug in the version of WP running on the site. The accepted answer on this thread gave me the solution.
You have destroyed a significant section of your database. Unless you have a backup you cannot get it back. What happened when you changed the varchar to an int was that every entry not recognized as an integer was converted to 0. You can see that in your screenshot. That is not reversible. Data was … Read more
get_the_modified_author(); isn’t going to tell you who published the post, just who last edited it. You will need to capture you publisher yourself. function post_published_notification( $ID, $post ) { $publisher = wp_get_current_user(); update_post_meta($ID,’my_publisher’,$publisher); } add_action( ‘publish_post’, ‘post_published_notification’, 10, 2 ); Then use get_post_meta($post_id,’my_publisher’) to retrieve the data. Of course there are a numerous ways to … Read more
You can use the add_meta_boxes hook to place a text field in the desired pages. Then on the template page you can check whether the user has entered some categories (display all categories if not) and filter the loop using the WP_Query, query_posts() or get_posts(). Here is an excellent article on the three methods.
I solved this issue by doing as shown below. I used Woo commerce Gift registry plugin replace the code with the below code in magenest-giftregistry-admin.php <?php if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly if (! defined ( ‘ABSPATH’ )) exit (); // Exit if accessed directly class Magenest_Giftregistry_Admin { … Read more
you could use restrict_manage_posts to add a dropdown field to the admin bar. however this code needs refining, because terms are not presented hierarchical atm. add_action( ‘restrict_manage_posts’, ‘my_restrict_manage_posts’ ); function my_restrict_manage_posts() { global $typenow; $taxonomy = ‘your_taxonomy_name’; if( $typenow != “page” && $typenow != “post” ){ $filters = array($taxonomy); foreach ($filters as $tax_slug) { $tax_obj … Read more