add_action('init', 'admin');
function admin(){
$args = array();
$args['share_icons']['twitter'] = array(
'link' => 'http://twitter.com/parisholley',
'title' => 'Folow me on Twitter',
'img' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_322_twitter.png'
);
$args['share_icons']['linked_in'] = array(
'link' => 'http://www.linkedin.com/in/parisholley',
'title' => 'Find me on LinkedIn',
'img' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_337_linked_in.png'
);
$args['opt_name'] = 'asyncjs'; #this is option name call by get_option('asyncjs ')
$args['menu_title'] = 'Async JS';
$args['page_title'] = 'Asynchronous Javascript';
$args['page_slug'] = 'asyncjs';
$args['show_import_export'] = false;
$args['page_position'] = 102419882;
$args['dev_mode'] = false;
$sections = array(array(
'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_280_settings.png',
'title' => 'Settings',
'fields' => array(
'exclude_name' => array(
'id' => 'exclude_name',
'type' => 'textarea',
'title' => 'Exclude by Name',
'desc' => 'Enter a comma delimited list (ie: "jquery,jqueryui").',
'sub_desc' => 'The name is the key used to queue the javascript file within wordpress.'
),
'exclude_js' => array(
'id' => 'exclude_js',
'type' => 'textarea',
'title' => 'Exclude by File',
'desc' => 'Enter a comma delimited list (ie: "file1.js,file2.js").',
'sub_desc' => 'If you do not know the script key, you exclude based on the file name.'
),
'head_file' => array(
'id' => 'head_file',
'type' => 'text',
'title' => 'Select Head.js File',
'desc' => 'Enter the filename of the head.js file in the js folder.',
'sub_desc' => 'This is an advanced setting, leave it as default if you are unsure of what it does.',
'std' => 'default xx'
),
'always_on' => array(
'id' => 'always_on',
'type' => 'checkbox',
'title' => 'Always include head.js file',
'desc' => 'Do you want to always include the head.js file in your head section even if there are no js files to output?',
'sub_desc' => 'This is useful if you\'re using some of the other features of head.js',
)
)
));
new NHP_Options($sections, $args);
}
|