Ejemplo n.º 1
0
/**
 * Please consider this projecct as an assigment from new PHP & WordPress student
 * and forgive me for mistakes in my codes.
 *
 * This is initial commit and i am working to get this plugin on track
 * Contributions to this plugin is much more appreciated
 * because we togther can make something cool and ofcourse i will get
 * great things to learn from you.
 *
 * I am looking forward for your Contributions
 *
 *
 *
 *@package annOptions
 *@version 1.0
 *@since 1.0
 **/
function annframe_admin_components()
{
    $annframe_options = annframe_opt_arr();
    register_setting('ann_sections', 'annframedb_options');
    //add_settings_section( 'general_settings', '', null, 'annSettings'  );
    foreach ($annframe_options['sections'] as $key) {
        add_settings_section($key['id'], $key['title'], null, 'annSettings');
    }
    foreach ($annframe_options['settings_fields'] as $key) {
        switch ($key['type']) {
            case 'text':
                add_settings_field($key['id'], $key['label'], 'annframe_input_text_callback', 'annSettings', 'general_settings', $key);
                break;
            case 'textarea':
                add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key);
                break;
            case 'upload':
                add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key);
                break;
            case 'checkbox':
                add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key);
                break;
            case 'radio':
                add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key);
                break;
            case 'select':
                add_settings_field($key['id'], $key['label'], 'annframe_allinone', $key['menu_slug'], $key['section'], $key);
                break;
        }
    }
}
Ejemplo n.º 2
0
		'upload',

	);
*
*/
foreach ($files as $file) {
    load_files($includes_dir . '/' . $file . '.php');
}
//foreach( $input_types as $inputs ) {
//	load_files( $input_dir.'/type-'.$inputs.'.php' );
//	}
function load_files($file)
{
    include_once $file;
}
$annframe_options = annframe_opt_arr();
$admin_menu = $annframe_options['admin_menu'];
//Register Admin Menu and Page.
if (!is_admin()) {
    return null;
} else {
    function annframe_admin_menu()
    {
        global $admin_menu;
        add_menu_page($admin_menu['page_title'], $admin_menu['menu_title'], $admin_menu['page_cap'], $admin_menu['menu_slug'], $admin_menu['callback_func'], '', '');
    }
}
add_action('admin_menu', 'annframe_admin_menu');
$annOptions = (array) get_option('annframedb_options');
function annframe_input_text_callback($key)
{