• Resolved zaheer01

    (@zaheer01)


    Hi,
    I am creating a plugin that needs to integrate with your plugin when my plugin creates the posts using wp_insert_post. Is there a way I programmatically update those hide posts checkboxes?

    My Code is not updating
    update_post_meta(129, ‘whp_hide_on_search’, 0);
    add_post_meta(129, ‘whp_hide_on_search’, 1);

Viewing 1 replies (of 1 total)
  • Plugin Author MartinCV

    (@martin7ba)

    Hi Zaheer,

    The key name starts with _ . As it is below.
    You can check this in plugin source code in /classes/admin/WHP_Post_Hide_Metabox.php

    $whp_data['_whp_hide_on_frontpage']     = ! empty( $_POST['whp_hide_on_frontpage'] ) ? true : false;
    $whp_data['_whp_hide_on_categories'] = ! empty( $_POST['whp_hide_on_categories'] ) ? true : false;
    $whp_data['_whp_hide_on_search'] = ! empty($_POST['whp_hide_on_search'] ) ? true : false;
    $whp_data['_whp_hide_on_tags'] = ! empty( $_POST['whp_hide_on_tags'] ) ? true : false;
    $whp_data['_whp_hide_on_authors'] = ! empty( $_POST['whp_hide_on_authors'] ) ? true : false;
    $whp_data['_whp_hide_in_rss_feed'] = ! empty( $_POST['whp_hide_in_rss_feed'] ) ? true : false;
    $whp_data['_whp_hide_on_blog_page'] = ! empty( $_POST['whp_hide_on_blog_page'] ) ? true : false;
    $whp_data['_whp_hide_on_date'] = ! empty( $_POST['whp_hide_on_date'] ) ? true : false;
    $whp_data['_whp_hide_on_post_navigation'] = ! empty( $_POST['whp_hide_on_post_navigation'] ) ? true : false;
Viewing 1 replies (of 1 total)
  • The topic ‘Programmatically update hide posts checkboxes’ is closed to new replies.