• Resolved apessoa

    (@apessoa)


    Hi John
    I really like your plugin and have been using it for a long time, to recicle posts and republish them to social media. You even incorporated the option to “re-draft/publish” the posts with new date, making the republish compatible with jetpack publicize ?? (something you helped me with a year ago).

    In previous versions of the plugin, one had the option to limit (publish/not publish) by category ID, whitch involved a bit of digging into categories, but allowed the plugin to be used with any taxonomy, regardless of post type. That was helpful, for example, for republishing woocommerce products.
    However, in a recent update, that option was changed (to make it easier to use) and categories are now displayed by name, but, unfortunately, only post categories are presented, thus leaving other post types taxonomy filtering outside the scope of the plugin.

    Is ther a way (functons?) to include additional post types in the categories displayed or to recover the previous functonality of filtering by ID?

    Thanks in advancce and best regards
    Alex

    • This topic was modified 6 years, 9 months ago by apessoa.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author johnh10

    (@johnh10)

    Sorry about that. This summer I’ll rewrite APS to be fast, more flexible, with lots of new features.

    For now, use this code snippet:

    add_filter( 'aps_eligible_query', 'change_aps_eligible_query' );
    
    function change_aps_eligible_query( $args ) {
      $args['cat'] = '5,46,49,88';
      return $args;
    }
    Thread Starter apessoa

    (@apessoa)

    Hi John
    Thank you for the prompt reply and solution. ??
    Just one question: in case of taxonomies I want to exclude, can I use the “minus” (-) sign before the cat ID?

    Like “….$args[‘cat’] = ‘-5,-46,49,88’;”

    Best regards

    Plugin Author johnh10

    (@johnh10)

    No, the WP_Query cats must be all inclusive or all exclusive.

    $args[‘cat’] = ‘-5,-46,49,88’;” would not make sense and that would mean only cats 49 and 88 AND every category except 5 and 46. I don’t know what WP would do with that.

    Thread Starter apessoa

    (@apessoa)

    Hi. Thanks for the update. In my case I want to republish all woocommerce cats except for a few, so I only add (minus) in all cats in the function, I guess that works perfect for me ??

    • This reply was modified 6 years, 8 months ago by apessoa.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Limit by category of other post types’ is closed to new replies.