Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Settings pages are created like this:

function pw_create_settings_page() {
	global $pw_settings_page;
	$pw_settings_page = add_options_page(__('My Plugin Settings', 'my-domain'), __('Plugin Settings', 'my-domain'), 'manage_options', 'my-page-slug', 'pw_callback_function');
}
add_action('admin_menu', 'pw_create_settings_page');
Comment

Settings pages are created like this:

function pw_load_scripts($hook) {
 
	global $pw_settings_page;
 
	if( $hook != $pw_settings_page ) 
		return;
 
	wp_enqueue_script( 'custom-js', plugins_url( 'js/custom.js' , dirname(__FILE__) ) );
}
add_action('admin_enqueue_scripts', 'pw_load_scripts');
Comment

PREVIOUS NEXT
Code Example
Php :: date fomat in php 
Php :: php Prefix Sum of Matrix (Or 2D Array) 
Php :: Laravel hasmany withSum() 
Php :: tina4 create route 
Php :: woocommerce disable payment method if coupon appied and total is 0 
Php :: utf8 decode 
Php :: default time zone for europe php 
Php :: codeigniter pagination example 
Php :: search bar php progress 
Php :: php double dollar not working in php version 8 
Php :: install php56-php-ldap on ubuntu 20.04 
Php :: php remove new line character from string 
Php :: Laravel eger loading relationship with selected column 
Php :: laravel Undefined index: token on reset 
Php :: Store Notice 
Php :: display product page title in field cf7 
Php :: print select sql result in php 
Php :: php artisan tinker new record 
Php :: Fibers - PHP 8.1 
Php :: image upload in cake 2 
Php :: Laravel: validate an integer field that needs to be greater than another 
Php :: ubuntu where are laravel logs stored 
Php :: php kurzschreibweise if 
Php :: php get first 5 letters of string 
Php :: bsljeet 
Php :: email with attcahment in joomla 
Php :: Anzeige von Custom Post Types in den Kategorien und Tags 
Php :: List all controllers in codeigniter HMVC structure 
Php :: run drush command from php 
Php :: Customizing The Validation Attributes 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =