• Resolved landwire

    (@landwire)


    Hi there,
    it would be nice to be able to choose which dynamic folders I want to display to have less clutter.

    For instance I do not use the “All Dates” folder at all…

    Thanks,
    Sascha

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author wickedplugins

    (@wickedplugins)

    Hi @landwire,

    Thanks for the feedback. This is a good idea and something we’ll consider adding to the plugin’s settings at some point.

    For now though, you can use a filter to remove the date dynamic folders if you’d like by adding the following code to your theme’s functions.php file:

    add_filter( 'wicked_folders_get_dynamic_folders', 'custom_wicked_folders_get_dynamic_folders', 10, 2 );
    
    function custom_wicked_folders_get_dynamic_folders( $folders, $args ) {
    
    	// Only filter page dynamic folders. Comment out to filter folders for all
    	// post types
    	if ( 'page' == $args['post_type' ] ) {
    		// Filter dynamic folders
    		$folders = array_filter( $folders, function( $folder ) {
    			// Exclude date dynamic folders
    			return ! is_a( $folder, 'Wicked_Folders_Date_Dynamic_Folder' );
    		} );
    	}
    
    	return $folders;
    
    }

    Hope this helps!

    Thread Starter landwire

    (@landwire)

    That absolutely helps! I hadn’t taken time yet to look at the possible hooks and filters of the plugin. I have been out of WordPress for a long time. Still like the availability of plugins, but really prefer Drupal 8 from a developer’s point of view.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable “All dates”’ is closed to new replies.