Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress filter category from widget

add_filter( 'widget_categories_args', 'widget_categories_args_filter', 10, 1 );
 
function widget_categories_args_filter( $cat_args ) {
    $exclude_arr = array( 4 );
     
    if( isset( $cat_args['exclude'] ) && !empty( $cat_args['exclude'] ) )
        $exclude_arr = array_unique( array_merge( explode( ',', $cat_args['exclude'] ), $exclude_arr ) );
    $cat_args['exclude'] = implode( ',', $exclude_arr );
    return $cat_args;
}
Comment

PREVIOUS NEXT
Code Example
Php :: Create fake users on click laravel 
Php :: insert views laravel database 
Php :: laravel return a single dimensional array 
Php :: string put inside tag string php 
Php :: Create progress bar with Laravel 
Php :: Update Custom Cart Count (or any HTML) after AJAX Add to Cart in WooCommerce 
Php :: increase file upload size limit 
Php :: php loop through obect 
Php :: hot to use functions in heredoc 
Php :: php function to get the last value of array 
Php :: update php 
Php :: sum of each group in laravel 
Php :: guzzle download file 
Php :: php post not working 
Php :: laravel orderby LCASE 
Php :: php array remove the last element 
Php :: magento 2 laravel valet 502 bad gateway 
Php :: check if any field update laravel 
Php :: wp post view 
Php :: laravel automatically encrypt model atribute 
Php :: download file on client from server url php 
Php :: php monolog 
Php :: php include file for its symlink directory 
Php :: php password_hash 
Php :: serve https with php local 
Php :: how to create module in laravel 
Php :: how to append an array into associative array 
Php :: public $baseURL codeigniter 4 
Php :: compress video file size php 
Php :: @can in laravel 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =