• Resolved ogrish

    (@ogrish)


    Thank you for a great plugin.

    I wonder where in the WordPress database information about folders is stored and how it can be accessed?

    Do you have a documentation of API-methods related to “Wicked folders”-plugin that are possible to use?

    Suppose I want to programmatically generate a list of pages or posts in a folder named ‘X-folder’, how can I do it?

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

    (@wickedplugins)

    Hi @ogrish,

    Wicked Folders uses the built-in WordPress taxonomy API to store folders. The folders are stored as taxonomies and terms in the database (in the wp_term_taxonomy, wp_term_relationships, wp_terms, and wp_termmeta tables).

    The folder taxonomies are named wf_{post_type}_folders where {post_type} is the machine name of a post type. For example, the taxonomy for page folders is wf_page_folders.

    Since folders are just terms, you can query pages and posts by them just like you would any other category. For example, you could use something like this to get all pages belonging to folder ID 1:

    get_posts( array(
    	'post_type' 		=> 'page',
    	'posts_per_page' 	=> -1,
    	'tax_query' 		=> array(
    		array(
    			'taxonomy' => 'wf_page_folders',
    			'field'    => 'term_id',
                'terms'    => 1,
    		)
    	)
    ) );

    I hope this helps. Let me know if I can answer any other questions.

    Plugin Author wickedplugins

    (@wickedplugins)

    Hi @ogrish,

    I’m going to mark this as resolved but if you still have questions, please let me know.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘API-methods related to “Wicked folders”?’ is closed to new replies.