option_defaults(); $bytab = $this->admin_get_options_by_tab( $currenttab ); foreach( $bytab as $id){ $new = (isset($newoptions[$id])?$newoptions[$id]:''); $old = (isset($oldoptions[$id])?$oldoptions[$id]:''); $opt = (isset($options[$id])?$options[$id]:''); $oldoptions[$id] = $this->MenuOptionsValidate( $new, $old, $opt ); // Make changes to existing options array } update_option( $this->get_private('settings'), $oldoptions); return $oldoptions; } ////////////////////////////////////////////////////////////////////////////////////// ////////////////////// Admin Option Functions ////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////// /** * Create array of option names for a given tab * * @ Since 1.2.0 */ function admin_get_options_by_tab( $tab = 'generator' ){ $default_options = $this->option_defaults(); $return = array(); foreach($default_options as $key => $val){ if( $val['tab'] == $tab ){ $return[$key] = $key; } } return $return; } /** * Create array of option names and current values for a given tab * * @ Since 1.2.0 */ function admin_get_settings_by_tab( $tab = 'generator' ){ $current = $this->get_all_options(); $default_options = $this->option_defaults(); $return = array(); foreach($default_options as $key => $val){ if( $val['tab'] == $tab ){ $return[$key] = $current[$key]; } } return $return; } /** * Create array of positions for a given tab along with a list of settings for each position * * @ Since 1.2.0 * @ Updated 1.2.3 */ function get_option_positions_by_tab( $tab = 'generator' ){ $positions = $this->admin_option_positions(); $return = array(); if( isset($positions[$tab]) ){ $options = $this->admin_get_options_by_tab( $tab ); $defaults = $this->option_defaults(); foreach($positions[$tab] as $pos => $info ){ $return[$pos]['title'] = (isset($info['title'])?$info['title']:''); $return[$pos]['description'] = (isset($info['description'])?$info['description']:''); $return[$pos]['options'] = array(); } foreach($options as $name){ $pos = (isset($defaults[$name]['position'])?$defaults[$name]['position']:'none'); $return[ $pos ]['options'][] = $name; } } return $return; } /** * Create array of positions for each widget along with a list of settings for each position * * @ Since 1.2.0 */ function admin_get_widget_options_by_position(){ $default_options = $this->option_defaults(); $positions = $this->admin_widget_positions(); $return = array(); foreach($positions as $key => $val ){ $return[$key]['title'] = $val; $return[$key]['options'] = array(); } foreach($default_options as $key => $val){ if(!empty($val['widget'])){ $return[ $val['position'] ]['options'][] = $key; } } return $return; } ////////////////////////////////////////////////////////////////////////////////////// /////////////////////// Admin Page Functions ////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////// /** * Create shortcode based on given options * * @ Since 1.1.0 * @ Update 1.2.5 */ function admin_generate_shortcode( $options, $optiondetails ){ $short = '['.$this->get_private('short'); $trigger = ''; foreach( $options as $key=>$value ){ if($value && isset($optiondetails[$key]['short'])){ if( isset($optiondetails[$key]['child']) && isset($optiondetails[$key]['hidden']) ){ $hidden = @explode(' ',$optiondetails[$key]['hidden']); if( !in_array( $options[ $optiondetails[$key]['child'] ] ,$hidden) ){ $short .= ' '.$optiondetails[$key]['short'].'="'.$value.'"'; } }else{ $short .= ' '.$optiondetails[$key]['short'].'="'.$value.'"'; } } } $short .= ']'; return $short; } /** * Define Settings Page Tab Markup * * @since 1.1.0 * @link`http://www.onedesigns.com/tutorials/separate-multiple-theme-options-pages-using-tabs Daniel Tara * */ function admin_options_page_tabs( $current = 'general' ) { $tabs = $this->admin_settings_page_tabs(); $links = array(); foreach( $tabs as $tab ){ $tabname = $tab['name']; $tabtitle = $tab['title']; if( $tabname == $current ){ $links[] = ''.$tabtitle.''; }else{ $links[] = ''.$tabtitle.''; } } echo '
'.$this->get_private('termsofservice').'
'; }?>the Alpine PressWordPress.org.
Please support further development of this plugin with a small donation.
A shortcode is a line of text that tells WordPress how to load a plugin inside the content of a page or post. Rather than explaining how to put together a shortcode, this tool will create the shortcode for you.
| '; $this->MenuDisplayCallback($options,$option,$fieldname,$fieldid); echo ' |
| '; $this->AdminDisplayCallback($options,$option,$fieldname,$fieldid); echo ' |
'.__('Need Help? Visit ').'the Alpine Press'.__(' for more about this plugin.').'