Hot answers tagged

3

The issue has nothing to do with the source code of a theme or plugin or with the configuration of Wordpress. It is: a 6+ months old bug in File block in Gutenberg that narrows down to a 4+ years old bug in core Wordpress. No solution exists for the moment, except for uploading files via Media section of Wordpress Dasboard. As file upload through that way ...


3

I would suggest first read the wordpress documentation about actions to understand how they work. Actions are aplit into two section, add_action and do_action do_action is the "location" where you hook into it. A basic example of do_action do_action('my_custom_action'); You can also pass arguments into do_action which can be available in ...


2

Not automatically. You don't know a filter exists until something tries to add it or runs it, and you have no guarantee what that filter is for without docs or a human being to describe it. You can do this by hand for core itself as it's well documented what the filters are, but there isn't a generic way to do this for 3rd party plugins/themes that provide ...


2

If you wanted to do this for all post types, you'd simply do define('EMPTY_TRASH_DAYS', 0); see https://codex.wordpress.org/Trash_status#EMPTY_TRASH_DAYS_option. But since you only want to do this for a custom post type, you will need to hook into 'trashed_post' like this: add_action('trashed_post', function( $post_id ){ [...] then check your trashed ...


1

You need to use strlen() to determine the length of a variable, so your second if condition is invalid. As it is, this question is not really related to Wordpress, so likely off-topic.


1

You get the error because WordPress attempted to parse the request which means WordPress tries to find a resource such as a post or category archive which matches the request URL (/download.php), and when not found, WordPress sets the HTTP status header to 404 Not Found. So to fix the issue, you could use parse_request instead of template_redirect, or call ...


1

You could do something like this add_action('pre_get_posts', 'bt_search_posts'); function bt_search_posts ($query) { // the posts ids that contain foo bar OR lorem ipsum dolor OR ping pong $posts_ids = []; // get the current query vars $query_vars = $query->query_vars; // loop each term we want to search and if found, add the post ...


1

The linked answer was written in 2019, yet the new field guide ("Adding icons in Twenty Twenty") was written about a year later (2020), so you should just use that new field guide, and in response to the main issue: I am trying to add an icon to the Twenty Twenty-One social icons, but having trouble registering it. You're getting the preg_match():...


Only top voted, non community-wiki answers of a minimum length are eligible