WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#26830 closed defect (bug) (invalid)

Featured Content Tag (JetPack installed) gets nulled by updating Settings -> Reading

Reported by: wasxxm Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

With the jetpack installed, you can set the tag for Featured Content in Appearance -> Customize (Featured Content enabled in theme). Try to set tag to something different than "featured" like "featured2". Then go to Settings -> Reading and hit 'Save Changes'. Go back to the featured content section and you will see the featured content tag has reverted to the default 'featured' tag.

After investigation it, I found out that the problem lies in /wp-admin/options.php. On line 128:

$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );

The filter somehow adds 'featured-content' to the array of $whitelist_optionsreading?. I searched jetpack installation for anything which might be adding featured-content option to the whitelist but there is none.

One possible patch is to add this after line 128:

if(($key = array_search('featured-content', $whitelist_options['reading'])) !== false) {
    unset($whitelist_options['reading'][$key]);
}

I hope this helps.

Attachments (1)

options.php (10.3 KB) - added by wasxxm 7 years ago.
/wp-admin/options.php

Download all attachments as: .zip

Change History (4)

@wasxxm
7 years ago

/wp-admin/options.php

#1 @markoheijnen
7 years ago

If it's because of JetPack then you should report this bug with them so they can fix it. You can report it to https://github.com/Automattic/jetpack/issues.

But I don't know JetPack that good but this is also a feature of Twenty Fourteen. Not sure if you use that as your theme. But they could easily conflict with each other.

If you send in a contribution then you need to create a patch for it. In this case your addition would be in the wrong place since it isn't core functionality so it should not be in core and it then should use the filters. That can be in JetPack or in Twenty Fourteen.

These links are part of our handbook. They describe how to create a patch and our coding standard. You will also find some other useful information.
http://make.wordpress.org/core/handbook/working-with-patches/patches-with-command-line/
http://make.wordpress.org/core/handbook/coding-standards/php/

#2 @knutsp
7 years ago

  • Component changed from General to Bundled Theme
  • Resolution set to invalid
  • Status changed from new to closed
  • Version set to 3.8

If this is not Jetpack, but WordPress core, please reopen.

#3 @ocean90
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.