Theme settings Page: Settings Api vs Update_Options

You are not wrong about conceptual limitation, but any development convention is inherently about constraints. Constraints are “bad”, but they are also often good and important. In this specific case it’s slightly soured by Settings API being especially nasty snowflake, which historically led people to reinvent this particular wheel a lot. However, your estimate of … Read more

Customizing Latest Post Pagination

Well I dug into the function I wrote a bit more and realize the flexibility of the customization I had. So I was able to achieve the above by writing the php this way: if (!function_exists(‘pagination’)){ function pagination($pages=””, $range = 2){ $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == ”){ … Read more

Settings API Message Error is global

The setting that is the first parameter is the not the option key. It is the key that you would’ve registered using register_setting register_setting( ‘settings_unique_key4172_91h, ‘option_key’, ‘name_of_sanitiser_function’ ); Then you can add settings errors like this, inside the callback function name_of_sanitiser_function(){ add_settings_error( ‘settings_unique_key4172_91h’, esc_attr( ‘settings_updated’ ), $message, $type ); } You might like a few … Read more

Getting all the settings for a plugin

Setting aren’t registered in the database by plugin, though a plugin should be using an identifying prefix. That is, there is no specific queryable cross-linking in the database between plugin and setting. The only way to way to pull all settings for a plugin is to know what keys the plugin has used to save … Read more

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