$data ){ self::add_meta_box( $type ); } //Also on posts and pages self::add_meta_box( 'post' ); self::add_meta_box( 'page' ); } /* * Function to Enqueue The Styles For The Options Page */ function enqueue_styles(){ wp_enqueue_style( 'style-admin-css', SOCIABLE_HTTP_PATH . 'css/style-admin.css' ); wp_enqueue_style( 'sociable-admin-css', SOCIABLE_HTTP_PATH . 'css/sociable-admin.css' ); wp_enqueue_style( 'sociablecss' , SOCIABLE_HTTP_PATH . 'css/sociable.css' ); } /* * Function To Enqueue The Scripts For The Options Page */ function enqueue_scripts(){ wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core',false,array('jquery')); wp_enqueue_script('jquery-ui-sortable',false,array('jquery','jquery-ui-core')); wp_enqueue_script( 'sociable-admin-js', SOCIABLE_HTTP_PATH . 'js/sociable-admin.js' , array( 'jquery','jquery-ui-core' , 'jquery-ui-sortable' ) ); wp_enqueue_script( 'admin-fn-js', SOCIABLE_HTTP_PATH . 'js/admin-fn.js' , array( 'jquery','jquery-ui-core' , 'jquery-ui-sortable' ) ); } /* * Function To Add The Settings Fields. */ function do_site_selection_list(){ global $sociable_options; $sociable_known_sites = get_option( 'sociable_known_sites' ); /* * Sort The List Based On The Active Sites So That They Display Correctly. */ $active_sites = isset( $sociable_options['active_sites'] ) && is_array( $sociable_options['active_sites'] ) ? $sociable_options['active_sites'] : array() ; //Start Blank $active = Array(); //Disabled Untill Proven Active $disabled = $sociable_known_sites; //Loop Through The Active Sites, sorting into 2 arrays foreach( $active_sites as $sitename => $value ) { $active[$sitename] = $disabled[$sitename]; unset( $disabled[$sitename] ); } uksort($disabled, "strnatcasecmp"); $sites = array_merge( $active, $disabled ); $imagepath = isset( $sociable_options['sociable_imagedir'] ) ? $sociable_options['sociable_imagedir'] : '' ; if ($imagepath == "") { $imagepath = trailingslashit( SOCIABLE_HTTP_PATH ) . 'images/'; } else { $imagepath .= trailingslashit( $imagepath ); } $out ='"; } /* * Create The HTML For The Options Page */ function Create_Options_Page(){ global $sociable_options; ?>

" />
Preview


Lorem ipsum dolor sit amet, consectetur adipiscing elit.



" />
name="sociable_options[help_grow]" id="LinkToSociable" />



/>16x16 Pixels value="32" type="radio" name="sociable_options[icon_size]" />32x32 Pixels value="48" type="radio" name="sociable_options[icon_size]"/>48x48 Pixels value="64" type="radio" name="sociable_options[icon_size]" />64x64 Pixels

value="option1" type="radio" /> /option1_.jpg" />

value="option2" type="radio" /> /option2_.jpg" />

value="option3" type="radio" /> /option3_.jpg" />

value="option4" type="radio" /> /option4_.jpg" />

value="option5" type="radio" /> /option5_.jpg" />

value="option6" type="radio" />

+

+

?>





ID,'_sociableoff',true ) ) { $checked = 'checked="checked"'; } wp_nonce_field( 'update_sociable_off' , 'sociable_nonce' ); echo '

' . __('Check This To Disable Sociable 2 On This Post Only.') . '

'; } function save_post( $post_id ){ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $post_id; // verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times $nonce = ( isset( $_POST['sociable_nonce'] ) ) ? $_POST['sociable_nonce'] : false ; if ( ! $nonce || ! wp_verify_nonce( $nonce, 'update_sociable_off' ) ) return $post_id; // Check permissions if ( 'page' == $_POST['post_type'] ){ if ( !current_user_can( 'edit_page', $post_id ) ) return; } else { if ( !current_user_can( 'edit_post', $post_id ) ) return; } //Lets Do This if( isset( $_POST['sociableoff'] ) ){ update_post_meta( $post_id, '_sociableoff' , $_POST['sociableoff'] ); } else { delete_post_meta( $post_id, '_sociableoff' ); } return $post_id; } /** * This Function Runs Before The Options Are Printed Out. */ function general_options_callback(){ return true; } /** * This Function Runs Before The Location Options Are Echoed Out. */ function location_options_callback(){ echo '

' . __( 'Please Select The Locations That You Wish To Allow The Sociable 2 Plugin To Insert The Links.' ) . '

'; } /** * Adds A Function For The add_settings_field(); function * * should be passed: * $data = array( * 'id' => 'field_id_and_name', * 'description' => 'field Description Should Go Here, This is Not The Title, Rather The Description' * ); */ function Checkbox( $data ){ global $sociable_options; //Save The Locations As a seperate array option if( isset( $data['locations'] ) ){ $name = 'sociable_options[locations][' . $data['id'] . ']'; $checked = ( isset( $sociable_options['locations'][$data['id']] ) ) ? 'checked="checked"' : '' ; } else { $name = 'sociable_options[' . $data['id'] . ']'; $checked = ( isset( $sociable_options[$data['id']] ) ) ? 'checked="checked"' : '' ; } echo ' ' . $data['description'] . ''; } function TextInput( $data ){ global $sociable_options; $value = ( isset( $sociable_options[$data['id']] ) ) ? $sociable_options[$data['id']] : ''; echo '
' . $data['description'] . ''; } function TextArea( $data ){ global $sociable_options; $value = ( isset( $sociable_options[$data['id']] ) ) ? $sociable_options[$data['id']] : ''; echo '
' . $data['description'] . ''; } function radio( $data ){ global $sociable_options; $cur_val = ( isset( $sociable_options[$data['id']] ) ) ? $sociable_options[$data['id']] : 0 ; echo '' . $data['description'] . '
'; foreach( $data['options'] as $value => $option ){ $selected = ( $value == $cur_val ) ? 'checked="checked"' : '' ; echo ' ' . $option . '
'; } } } ?> '; } //add_action('admin_head', 'add_ie7' ); ?>