if (!$widgetareas_list) {
    $widgetareas_list = array('none' => _x('None', 'backend metabox', 'the7mk2'));
}
// Ordering settings
$order_options = array('ASC' => _x('ascending', 'backend', 'the7mk2'), 'DESC' => _x('descending', 'backend', 'the7mk2'));
$orderby_options = array('ID' => _x('ID', 'backend', 'the7mk2'), 'author' => _x('author', 'backend', 'the7mk2'), 'title' => _x('title', 'backend', 'the7mk2'), 'date' => _x('date', 'backend', 'the7mk2'), 'name' => _x('name', 'backend', 'the7mk2'), 'modified' => _x('modified', 'backend', 'the7mk2'), 'parent' => _x('parent', 'backend', 'the7mk2'), 'rand' => _x('rand', 'backend', 'the7mk2'), 'comment_count' => _x('comment_count', 'backend', 'the7mk2'), 'menu_order' => _x('menu_order', 'backend', 'the7mk2'));
$yes_no_options = array('1' => _x('Yes', 'backend metabox', 'the7mk2'), '0' => _x('No', 'backend metabox', 'the7mk2'));
$enabled_disabled = array('1' => _x('Enabled', 'backend metabox', 'the7mk2'), '0' => _x('Disabled', 'backend metabox', 'the7mk2'));
// Image settings
$repeat_options = array('repeat' => _x('repeat', 'backend', 'the7mk2'), 'repeat-x' => _x('repeat-x', 'backend', 'the7mk2'), 'repeat-y' => _x('repeat-y', 'backend', 'the7mk2'), 'no-repeat' => _x('no-repeat', 'backend', 'the7mk2'));
$position_x_options = array('center' => _x('center', 'backend', 'the7mk2'), 'left' => _x('left', 'backend', 'the7mk2'), 'right' => _x('right', 'backend', 'the7mk2'));
$position_y_options = array('center' => _x('center', 'backend', 'the7mk2'), 'top' => _x('top', 'backend', 'the7mk2'), 'bottom' => _x('bottom', 'backend', 'the7mk2'));
$load_style_options = array('ajax_pagination' => _x('Pagination & filter with AJAX', 'backend metabox', 'the7mk2'), 'ajax_more' => _x('"Load more" button & filter with AJAX', 'backend metabox', 'the7mk2'), 'lazy_loading' => _x('Lazy loading', 'backend metabox', 'the7mk2'), 'default' => _x('Standard (no AJAX)', 'backend metabox', 'the7mk2'));
$font_size = array('h1' => _x('h1', 'backend metabox', 'the7mk2'), 'h2' => _x('h2', 'backend metabox', 'the7mk2'), 'h3' => _x('h3', 'backend metabox', 'the7mk2'), 'h4' => _x('h4', 'backend metabox', 'the7mk2'), 'h5' => _x('h5', 'backend metabox', 'the7mk2'), 'h6' => _x('h6', 'backend metabox', 'the7mk2'), 'small' => _x('small', 'backend metabox', 'the7mk2'), 'normal' => _x('medium', 'backend metabox', 'the7mk2'), 'big' => _x('large', 'backend metabox', 'the7mk2'));
$accent_custom_color = array('accent' => _x('Accent', 'backend metabox', 'the7mk2'), 'color' => _x('Custom color', 'backend metabox', 'the7mk2'));
$proportions = presscore_meta_boxes_get_images_proportions();
$proportions_max = count($proportions);
$proportions_maybe_1x1 = array_search(1, wp_list_pluck($proportions, 'ratio'));
$rev_sliders = $layer_sliders = array('none' => _x('none', 'backend metabox', 'the7mk2'));
if (class_exists('RevSlider')) {
    $rev = new RevSlider();
    $arrSliders = $rev->getArrSliders();
    foreach ((array) $arrSliders as $revSlider) {
        $rev_sliders[$revSlider->getAlias()] = $revSlider->getTitle();
    }
}
if (function_exists('lsSliders')) {
    $layerSliders = lsSliders();
    foreach ($layerSliders as $lSlide) {
        $layer_sliders[$lSlide['id']] = $lSlide['name'];
    }
Ejemplo n.º 2
0
 /**
  * Add proportions to images.
  *
  * @return array.
  */
 function presscore_add_thumbnail_class_for_masonry($args = array())
 {
     $config = Presscore_Config::get_instance();
     $thumb_proportions = $config->get('thumb_proportions');
     if ('resize' == $config->get('image_layout') && $thumb_proportions) {
         if (is_array($thumb_proportions)) {
             $width = $thumb_proportions['width'] > 0 ? absint($thumb_proportions['width']) : 1;
             $height = $thumb_proportions['height'] > 0 ? absint($thumb_proportions['height']) : 1;
             $args['prop'] = $width / $height;
         } else {
             $args['prop'] = presscore_meta_boxes_get_images_proportions($thumb_proportions);
         }
     }
     return $args;
 }
Ejemplo n.º 3
0
	/**
	 * Add metaboxes scripts and styles.
	 */
	function presscore_admin_scripts( $hook ) {
		if ( !in_array( $hook, array( 'post-new.php', 'post.php' ) ) ) {
			return;
		}

		$template_uri = get_template_directory_uri();

		wp_enqueue_style( 'dt-mb-magick', $template_uri . '/inc/admin/assets/admin_mbox_magick.css' );

		wp_enqueue_script( 'dt-metaboxses-scripts', $template_uri . '/inc/admin/assets/custom-metaboxes.js', array('jquery'), false, true );
		wp_enqueue_script( 'dt-mb-magick', $template_uri . '/inc/admin/assets/admin_mbox_magick.js', array('jquery'), false, true );
		wp_enqueue_script( 'dt-mb-switcher', $template_uri . '/inc/admin/assets/admin_mbox_switcher.js', array('jquery'), false, true );

		// for proportion ratio metabox field
		$proportions = presscore_meta_boxes_get_images_proportions();
		$proportions['length'] = count( $proportions );
		wp_localize_script( 'dt-metaboxses-scripts', 'rwmbImageRatios', $proportions );
	}
 /**
  * Add metaboxes scripts and styles.
  */
 function presscore_admin_post_scripts($hook)
 {
     if (!in_array($hook, array('post-new.php', 'post.php'))) {
         return;
     }
     wp_enqueue_style('dt-mb-magick', PRESSCORE_ADMIN_URI . '/assets/admin_mbox_magick.css');
     wp_enqueue_script('dt-metaboxses-scripts', PRESSCORE_ADMIN_URI . '/assets/custom-metaboxes.js', array('jquery'), false, true);
     wp_enqueue_script('dt-mb-magick', PRESSCORE_ADMIN_URI . '/assets/admin_mbox_magick.js', array('jquery'), false, true);
     // enqueue only for pages
     if ('page' === get_post_type()) {
         wp_enqueue_script('dt-mb-switcher', PRESSCORE_ADMIN_URI . '/assets/admin_mbox_switcher.js', array('jquery'), false, true);
     }
     // for proportion ratio metabox field
     $proportions = presscore_meta_boxes_get_images_proportions();
     $proportions['length'] = count($proportions);
     wp_localize_script('dt-metaboxses-scripts', 'rwmbImageRatios', $proportions);
 }