How to add a new plugin page under desired Options page?

Use add_submenu_page instead. <?php add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); ?> $parent_slug should be one of the following For Dashboard: add_submenu_page( ‘index.php’, … ); Also see add_dashboard_page() For Posts: add_submenu_page( ‘edit.php’, … ); Also see Also see add_posts_page() For Media: add_submenu_page( ‘upload.php’, … ); Also see add_media_page() For Links: add_submenu_page( ‘link-manager.php’, … ); … Read more

Notice: _usort_terms_by_ID is deprecated since version 4.7.0! Use wp_list_sort instead

The function wp_list_sort() has been introduced in WordPress 4.7. It wasn’t available before. That’s probably why your plugin isn’t using it. The function _usort_terms_by_ID() is still working, and it is actually much faster than wp_list_sort(). Which makes it hard to understand why it has been deprecated. But in your own code keep in mind that … Read more

Enqueue script only when shortcode is used, with WP Plugin Boilerplate

Why it’s not working: You need to use the wp_enqueue_scripts action hook. You’ve used wp_register_script as an action hook, however, there is no action hook named wp_register_script in WordPress core. If this was just a silly mistake, then you already have the answer. Read on if you need more information regarding the topic: Attaching a … Read more

jQuery in header or footer

There is a lot of leftovers in script-related articles in Codex that are not entirely correct (putting it mildly). The enqueue should not be done before wp_head(), it should be done on wp_enqueue_scripts. Which is technically early inside wp_head(). It doesn’t harm performance, because registering/enqueueing script is merely explaining to WordPress how it should be … Read more

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