Getting Plugin directory and url

Use the plugin_dir_path() and plugin_dir_url() helper functions: if( ! defined( ‘MY_PLUGIN_PATH’ ) ) define( ‘MY_PLUGIN_PATH’, plugin_dir_path( __file__ ) . ‘admin/’ ); if( ! defined( ‘MY_PLUGIN_DIR’ ) ) define( ‘MY_PLUGIN_DIR’, plugin_dir_url( __file__ ) . ‘admin/’ ); You should be using more unique constant names – ADMIN_PATH is far too generic.

Embed php code in custom field of a plugin [closed]

Looking at the Other Notes of the plugin, you can use one of the variables to insert the post url. $post_url – Replaced with the URL of the post which was published Edit: You would just add the $post_url variable within your body field. <a href=”https://wordpress.stackexchange.com/questions/226286/$post_url”>$title</a>

Deprecated error notice

The deprecated notice is pretty clear: Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. The only place you use a user level it here: add_options_page( ‘Seach by Category Options’, ‘Search by Category’, 10, basename(__FILE__), array(‘SBC_Admin’, ‘config_page’) ); See that “10”? Don’t do that. Use a role, such as … Read more