$value){ // $value = "aFS".$value; // $$value = ''; // } /* M E T A B O X E S ================= */ /* Metabox for Posts and Other Content Types */ function aFSPostMetaBox(){ $aFSOptions = get_option('aFSOpts'); if(isset($aFSOptions['aFSJSCSSOff'])){ $args = array( 'public' => true ); $post_types = get_post_types($args); add_meta_box('aFSPostMB','Slides Settings','aFSPMB',$post_types,'side','low'); } } aFSPostMetaBox(); function aFSPMB($post){ $aFSPost = get_post_custom($post->ID); $aFSJSCSSOn = isset($aFSPost['aFSJSCSSOn']) ? $aFSPost['aFSJSCSSOn'][0] : ''; wp_nonce_field('aFS_nonce','aFS_mb_nonce'); ?>
/>
ID); foreach ($aFSVarList as $opt => $value){ $value = "aFS".$value; $$value = isset($aFSVals[$value]) ? $aFSVals[$value][0] : ''; } wp_nonce_field('aFSNonce','aFSMBNonce'); function aFSSetPreview($color=NULL,$grad=NULL,$img=NULL,$fill=NULL,$repeat=NULL,$opac=NULL,$xy=NULL,$fixed=NULL){ $css = ''; if($grad){ $css = $css .'background-image: '.$grad.'; '; } if($color){ $css = $css .'background-color: '.$color.'; '; } if($opac){ $css = $css .'opacity: '.$opac.'; '; } if($img){ $css = $css .'background-image: url('.$img.'); '; } if($fill === 'contain'){ $css = $css .'background-size: contain; '; } elseif($fill === 'actual'){ $css = $css .'background-size: auto; '; } elseif($fill === 'stretch'){ $css = $css .'background-size: 100% 100%; '; } else{ $css = $css .'background-size: cover; '; } if($repeat === 'r'){ $css = $css .'background-repeat: repeat; '; } elseif($repeat === 'x'){ $css = $css .'background-repeat: repeat-x; '; } elseif($repeat === 'y'){ $css = $css .'background-repeat: repeat-y; '; } else{ $css = $css .'background-repeat: no-repeat; '; } $xp = ""; $yp = ""; if($xy === 'lt' || $xy === 'lm' || $xy === 'lb'){ $xp = "0%"; } elseif($xy === 'rt' || $xy === 'rm' || $xy === 'rb'){ $xp = "100%"; } else{ $xp = "50%"; } if($xy === 'lt' || $xy === 'ct' || $xy === 'rt'){ $yp = "0%"; } elseif($xy === 'lb' || $xy === 'cb' || $xy === 'rb'){ $yp = "100%"; } else{ $yp = "50%"; } $css = $css .'background-position: '.$xp.' '.$yp.'; '; if($fixed){ $css = $css .'background-attachment: fixed;'; } else{ $css = $css .'background-attachment: auto;'; } echo 'style="'.$css.'"'; } function aFSSwatches() { ?>Warning: The link selector (in this version of AddFunc Slides) highjacks the function used for adding links in the main editor (for Slides only, not Pages, Posts, etc.). The adverse result is that after you save the Slide, the link Quicktag (in Text view) adds your chosen URL to the Slide Options Link field instead of your highlighted text in the editor. Therefore, links have to be added in the editor manually or created in Visual mode. These are known issues. The Link field does however store any valid data that is entered.
'."\n" .' var aFSswatches = [("White","#ffffff"),("Black","#000000")]'."\n" .' $(\'input.aFcolorpikr\').minicolors({'."\n" .' control: \'wheel\','."\n" .' format: \'rgb\','."\n" .' keywords: \'currentColor,inherit,initial,transparent\','."\n" .' opacity: true,'."\n" .' swatches: aFSswatches,'."\n" .' });'."\n" .''."\n"; echo $js; } } add_action('admin_footer', 'aFSAdminJSConfig');