Any reason not to remove all default WP plugins?

According to the Site Health screen https://github.com/WordPress/wordpress-develop/blob/db30405f478e9813b0cc59f81992f16eb0a29ced/src/wp-admin/includes/class-wp-site-health.php#L470 Inactive plugins are tempting targets for attackers. If you’re not going to use a plugin, you should consider removing it. Default plugins are Hello Dolly and Akismet. Your hosting provider is most likely adding the other plugins you mentioned as pre-installed plugins for their customers as an extra … Read more

Timber – Twig post.content returns null can’t create ACF Gutenberg blocks

You will need to add the current page object to the timber context using timber_context filter. Something like this add_filter(‘timber_context’, ‘bt_timber_add_to_context’); function bt_timber_add_to_context ($context) { // add current page content $context[‘page’] = Timber::get_post(); return $context; } That’s how I added it in my custom timber theme. Now when you want to get the page content … Read more

WordPress custom taxonomy not showing

$terms = get_terms( array( ‘taxonomy’ => ‘career’, ‘hide_empty’ => false, ) ); Your taxonomy isn’t called career. Your taxonomy is called (confusingly) categories. If you check the docs, you’ll see the second argument passed to register_taxonomy is the object type (eg, post, my_cpt) that the tax is to be used on. So in your registration … Read more

Finding the screen id of a page generated with add_menu_page

The function add_menu_page return the hook suffix that inform you about the current page. A simple example to get the hook suffix. public function add_menu_page() { $page_hook_suffix = add_menu_page( esc_html__( ‘Admin Page’, ‘translation-slug’ ), esc_html__( ‘Admin Page’, ‘translation-slug’ ), ‘read’, ‘My Name’, array( $this, ‘get_styles’ ) ); add_action( ‘admin_print_scripts-‘ . $page_hook_suffix, array( $this, ‘enqueue_assets’ ) … Read more

Choose which plugin to run based on user?

Before loading plugins WP retrieves the list of active and valid plugins with the function wp_get_active_and_valid_plugins. The array of plugins is retrieved in this line: $active_plugins = (array) get_option( ‘active_plugins’, array() ); As you can see, this involves a call to get_option, which has a filter to manipulate the result. So if you could build … Read more

XML parser plugin

XML as in generic XML? I mostly mess with RSS (for which WordPress has SimplePie bundled). Maybe SimpleXML (PHP 5+, not WP specific) will do? Also quick repository search found this: Advanced XML Reader