Most efficient way to use classes to create admin pages using Settings API

The example in Settings API documentation uses admin_init and admin_menu for registering custom settings and admin pages. https://developer.wordpress.org/plugins/settings/custom-settings-page/ There’s also an old Codex entry on actions typically run on front and back end requests, which can help pick a suitable action hook. https://codex.wordpress.org/Plugin_API/Action_Reference I also highly recommend the excellent old Q&A about instantiating classes in … Read more

Trying to get property of non-object

If you look at the documentation for get_term_by(), you’ll see that it: Will return false if $taxonomy does not exist or $term was not found. You need to account for this possibility in your code by checking the value of $term. You’ll also note from the documentation that get_term_by() does not return a WP_Error, so … Read more

Is the object cached?

If you use the WordPress API to retrieve the metadata, then it should be cached for you. If you do other complex stuff, there is the Transients API for caching data yourself, which will take advantage of whatever object cache you use with WordPress. EDIT – I should clarify, it’ll be loaded for each request … Read more

TInyMCE object Tag stripped

I’m not 100% sure, but this problem seems related to the unfiltered_html capability restriction. unfiltered_html Since 2.0 Allows user to post HTML markup or even JavaScript code in pages, posts, and comments. Note: Enabling this option for untrusted users may result in their posting malicious or poorly formatted code. An easy fix (and probably a … Read more

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