Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wps_subtitle_key filter does not affect all cases of the subtitle meta key #52

Open
benlk opened this issue Jul 18, 2020 · 1 comment
Open

Comments

@benlk
Copy link

benlk commented Jul 18, 2020

The plugin defines a filter wps_subtitle_key which changes the post meta key used to store the subtitle:

/**
* Get Default Subtitle
*
* @since 2.8
*
* @return string Default title.
*/
public function get_default_subtitle() {
return apply_filters( 'wps_default_subtitle', '', $this->post_id );
}

However, this filter doesn't affect the meta key used in the REST endpoint:

update_post_meta( $object->ID, 'wps_subtitle', wp_kses_post( $value ) );

There are several other places in the plugin that similarly use a hardcoded wps_subtitle meta key instead of the filter output. https://github.com/benhuson/wp-subtitle/search?l=PHP&q=wps_subtitle

@benhuson
Copy link
Owner

Searching the codebase returns many "wps_subtitle" but I think it might just be the REST reference, and the one in the is_current_subtitle() that reference the meta key and need to run through that filter.

Please check PR #55

I think this fixes the places where required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants