Support » Fixing WordPress » Permanent Plugin code replace – even when updating

  • I am trying to replace plugin core files, I want a way to find and replace core files as I might need to update the plugin later.

    plugin is WooCommerce

    Location of the file :

    With this can disable pagination feature:

    'variations_per_page' => absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) )


    'variations_per_page' => absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 1000 ) )

    After some digging I found plugin called “Code Snippets” but wouldn’t help, not sure how to do some way to edit the core files of plugins without get effected after update.

    looking for something like virtual file modification for WordPress which can edit core in cache mode only, similar to vQmod

Viewing 1 replies (of 1 total)
  • Moderator Steve Stern


    Guardian of the Interwebs

    You can’t. You shouldn’t. You’ll note that’s an apply_filters call, so you’d create a callback function for add_filter to change the value and either put it a plugin of your own or add it to your theme’s functions.php.


    Your function would be *something like*

    // define the woocommerce_admin_meta_boxes_variations_per_page callback 
    function filter_woocommerce_admin_meta_boxes_variations_per_page( $int ) {  
        return 15; //or whatever you want to change it to.
    // add the filter 
    add_filter( 'woocommerce_admin_meta_boxes_variations_per_page', 'filter_woocommerce_admin_meta_boxes_variations_per_page', 10, 1 ); 
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.