1. Home
  2. Matador Extensions
  3. Syndication XML Feeds
  4. DocCafé Feed: Modifying default values for the Is Featured and Resume Only Fields

DocCafé Feed: Modifying default values for the Is Featured and Resume Only Fields

The DocCafé feed uses default values for the ‘is featured’ and ‘accepted with resume only’ feed fields. Both are set to false by default.

The default value can be modified using a filter:

Here is an example of using the ‘matador_extension_feeds_doccafe_is_featured’ filter to return true in this feed field if the job belongs to the ‘featured’ category.

function check_if_featured( $is_featured, $post_id ) {
    if ( has_category( 'featured', $post_id ) ) {

        return 'true';
    }

    return $is_featured;
}

add_filter( 'matador_extension_feeds_doccafe_is_featured', 'check_if_featured', 10, 2 );

Here is an example of using the ‘matador_extension_feeds_doccafe_resume_only_accepted’ filter to set the value to true in the feed if the job has ‘true’ set as the value of ‘customText2’ in the job’s postmeta.

function check_custom_text1( $resume_only_accepted, $post_id ) {

    $custom_text1 = get_post_meta( $post_id, 'customText1', true );

    if ( 'true' === $custom_text1 ) {

        return 'true';
    }

    return $resume_only_accepted;
}

add_filter('matador_extension_feeds_doccafe_resume_only_accepted', 'check_custom_text1', 10, 2);

Updated on June 17, 2024
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support