How can I allow the Editor Role to change Theme Settings?

you can add capabilities to the editor role using the role object and add_cap from you functions.php <?php // get the the role object $editor = get_role(‘editor’); // add $cap capability to this role object $editor->add_cap(‘edit_theme_options’); ?> you can also remove capabilities: $editor->remove_cap(‘delete_posts’); just take a look at the list of capabilities and what each … Read more

Disable plugin / plugin action via theme

When WordPress activates a plugin, it calls the activate_plugin() function. This function activates the plugin in a sandbox and redirects somewhere else on success. It’s been used by a few authors to programmatically activate plugin dependencies. There’s another function, deactivate_plugins(), that does a similar thing in reverse … it’s actually how WordPress deactivates plug-ins when … Read more

Where are Additional CSS files stored

It’s stored in the database, within the wp_posts table, under the custom_css post type, where the post name is the theme slug. There you also have the related customize_changeset and revision post types. The custom css post ID is also stored in the wp_options table under each theme mods, e.g. theme_mods_twentysixteen for Twenty Sixteen. It’s … Read more

if ( is_home() && ! is_front_page() )

This will display the title of the page when a static page is set to show posts. E.g. I show posts on my homepage… It’ll do nothing. If I, say, show posts on page titled News… It’ll show News in H1. This is used so that the title of the page is shown, whenever posts … Read more

Using OOP in themes

I can understand your confusion based on the example you provided. That’s really a poor way to use a class … and just because a class is used, doesn’t make a system OOP. In the case of Hybrid, they’re just using a class to namespace their functions. Considering Hybrid is a theme framework, this is … Read more

Remove JSON API links in header html

I see in filters.php “add_action( ‘wp_head’, ‘rest_output_link_wp_head’, 10, 0 )” Which makes me think this should do the trick to remove rel=”https://api.w.org/”. remove_action( ‘wp_head’, ‘rest_output_link_wp_head’ ); The rest… * cough * seem to be in default-filters.php remove_action( ‘wp_head’, ‘wp_oembed_add_discovery_links’ ); To remove the rest_output_link_header remove_action( ‘template_redirect’, ‘rest_output_link_header’, 11 ); Reference wp_oembed_add_discovery_links rest_output_link_wp_head rest_output_link_header

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)