This file contains 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 characters
<?php | |
/** | |
* Disable option to deactivate Plugin | |
* | |
* @param $actions | |
* @param $plugin_file | |
* @param $plugin_data | |
* @param $context | |
* @return mixed | |
*/ |
This file contains 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 characters
<?php | |
/** | |
* Remove Gutenberg Block Library CSS from loading on the frontend | |
*/ | |
function dctit_remove_wp_block_library_css(){ | |
wp_dequeue_style( 'wp-block-library' ); | |
wp_dequeue_style( 'wp-block-library-theme' ); | |
wp_dequeue_style( 'wc-block-style' ); // Remove WooCommerce block CSS | |
} | |
add_action( 'wp_enqueue_scripts', 'dctit_remove_wp_block_library_css', 100 ); |
This file contains 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 characters
<?php | |
/** | |
* When using relevanssi search with visual composer, search results come with some vc_* shortcode. | |
* Relevanssi by default removes some of the shortcodes. Sometimes theme also include some custom vc shorttcode. | |
* This code will remove all of those unwanted vc_* shortcodes from search result. | |
* | |
* Goes inside functions.php of active theme | |
*/ | |
add_filter( 'relevanssi_pre_excerpt_content', 'dctit_vc_filtered_content', 99 ); | |
add_filter( 'relevanssi_post_content', 'dctit_vc_filtered_content', 99 ); |
This file contains 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 characters
<?php | |
/** | |
* ACF fields don't show up when previewing draft posts. This is an ugly hack to try and overcome that situation. | |
*/ | |
function dctit_hack_preview() { | |
$post_types = array ( 'post', 'page' );//add/edit/delete post types as needed | |
global $post; | |
if ( !in_array( $post->post_type, $post_types ) ) { | |
return; |
This file contains 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 characters
<?php | |
/** | |
* code goes inside "includes/hooks" directory | |
*/ | |
//for customizing nav menu items | |
use WHMCS\View\Menu\Item as MenuItem; | |
//for interacting with DB | |
use Illuminate\Database\Capsule\Manager as Capsule; |
This file contains 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 characters
<?php | |
/** | |
* code goes inside "includes/hooks" directory | |
*/ | |
/** | |
* Remove Announcements from homepage | |
*/ | |
function dctit_remove_announcements_from_homepage( $home_page_panels) { | |
$home_page_panels->removeChild('Recent News'); |
This file contains 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 characters
<?php | |
/** | |
* code goes inside "includes/hooks" directory | |
*/ | |
/** | |
* Client Area Ticket View - Show Oldest Reply First | |
* @param $vars | |
* @return array | |
*/ |
This file contains 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 characters
<?php | |
/* | |
* Modify Default Search URL | |
* old url: domain.com?s=[search_term] | |
* new url: domain.com/search/[search_term] | |
*/ | |
function dctit_change_search_url() { | |
if ( is_search() && ! empty( $_GET['s'] ) ) { | |
wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) ); | |
exit(); |
NewerOlder