• Hi

    I am using a plugin which create custom post type. I want to override parameter value of args in my function file. like i want to change this parameter “‘exclude_from_search’ => true” into “‘exclude_from_search’ => false”.
    $args = array(
    ‘labels’ => $labels,
    ‘public’ => true,
    ‘publicly_queryable’ => true,
    ‘exclude_from_search’ => true
    )

    I changed directly in plugin file but after updating the new plugin version its changed back. Please give me the solution.
    Thanks

Viewing 1 replies (of 1 total)
  • Hi hypesol,

    To do this_> best practice is to modify your changes thorough your wp theme’s functions.php file by use of hook.

    For Ex.

    add_action ( 'hook_name', 'your_function_name', [priority], [accepted_args] );
    
    function your_function_name() {
    
    // Your staffs in here
    
    }

    Regards,
    Debabrata

Viewing 1 replies (of 1 total)
  • The topic ‘How to override args of Custom Post Type’ is closed to new replies.