Last active
July 16, 2019 12:01
-
-
Save anibalardid/5f20826b2edb81c832fddbe4f31f23f6 to your computer and use it in GitHub Desktop.
Revisions
-
anibalardid revised this gist
Apr 10, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ <?php // My post: https://es.wordpress.org/support/topic/tutorial-como-deshabilitar-algunos-plugins-de-algunas-paginas-especificas/ /* Plugin Name: Plugin Selector Plugin URI: https://ardid.com.ar -
anibalardid revised this gist
Feb 27, 2019 . No changes.There are no files selected for viewing
-
anibalardid revised this gist
Feb 27, 2019 . No changes.There are no files selected for viewing
-
anibalardid created this gist
Feb 27, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ <?php /* Plugin Name: Plugin Selector Plugin URI: https://ardid.com.ar Description: Removes plugins in selected pages Author: Anibal Ardid Version: 1.0 Author URI: https://ardid.com.ar */ if (!is_admin()) { add_filter( 'option_active_plugins', 'plugin_selector' ); function plugin_selector($plugins){ if(strpos($_SERVER['REQUEST_URI'], '/search/') === 0) { // KK Star Ratings $key = array_search( 'kk-star-ratings/index.php', $plugins ); if ( false !== $key ) { unset( $plugins[$key] ); } // Shareaholic $key = array_search( 'shareaholic/shareaholic.php', $plugins ); if ( false !== $key ) { unset( $plugins[$key] ); } // Genesis Responsive Slider $key = array_search( 'genesis-responsive-slider/genesis-responsive-slider.php', $plugins ); if ( false !== $key ) { unset( $plugins[$key] ); } // Contextual Related Posts $key = array_search( 'contextual-related-posts/contextual-related-posts.php', $plugins ); if ( false !== $key ) { unset( $plugins[$key] ); } } elseif($_SERVER['REQUEST_URI'] === '/' || $_SERVER['REQUEST_URI'] === '') { // KK Star Ratings $key = array_search( 'kk-star-ratings/index.php', $plugins ); if ( false !== $key ) { unset( $plugins[$key] ); } // Shareaholic $key = array_search( 'shareaholic/shareaholic.php', $plugins ); if ( false !== $key ) { unset( $plugins[$key] ); } } return $plugins; } }