Exemplo n.º 1
0
 /**
  * Enqueue scripts and styles.
  */
 public static function admin_enqueue_scripts()
 {
     // Group field is the 1st param
     $args = func_get_args();
     $fields = $args[0]['fields'];
     // Load clone script conditionally
     foreach ($fields as $field) {
         if ($field['clone']) {
             wp_enqueue_script('rwmb-clone', RWMB_JS_URL . 'clone.js', array('jquery-ui-sortable'), RWMB_VER, true);
             break;
         }
     }
     // Enqueue sub-fields scripts and styles.
     foreach ($fields as $field) {
         RWMB_Field::call($field, 'admin_enqueue_scripts');
     }
     // Use helper function to get correct URL to current folder, which can be used in themes/plugins.
     list(, $url) = RWMB_Loader::get_path(dirname(__FILE__));
     wp_enqueue_style('rwmb-group', $url . 'group.css', '', '1.1.2');
     wp_enqueue_script('rwmb-group', $url . 'group.js', array('jquery'), '1.1.2', true);
 }
Exemplo n.º 2
0
 /**
  * Enqueue scripts and styles for tabs
  */
 public function enqueue()
 {
     list(, $url) = RWMB_Loader::get_path(dirname(__FILE__));
     wp_enqueue_style('rwmb-tabs', $url . 'tabs.css', '', '1.0.0');
     wp_enqueue_script('rwmb-tabs', $url . 'tabs.js', array('jquery'), '1.0.0', true);
 }
Exemplo n.º 3
0
<?php

/**
 * Plugin Name: Meta Box
 * Plugin URI: https://metabox.io
 * Description: Create custom meta boxes and custom fields for any post type in WordPress.
 * Version: 4.9.8
 * Author: Rilwis
 * Author URI: http://www.deluxeblogtips.com
 * License: GPL2+
 * Text Domain: meta-box
 * Domain Path: /languages/
 */
if (defined('ABSPATH') && !defined('RWMB_VER')) {
    require_once dirname(__FILE__) . '/inc/loader.php';
    $loader = new RWMB_Loader();
    $loader->init();
}
Exemplo n.º 4
0
 /**
  * Enqueue scripts and styles for columns
  */
 public function enqueue()
 {
     list(, $url) = RWMB_Loader::get_path(dirname(__FILE__));
     wp_enqueue_style('rwmb-columns', $url . 'columns.css', '', '1.0.0');
 }
 /**
  * Enqueue plugin scripts
  */
 public function enqueue()
 {
     list(, $url) = RWMB_Loader::get_path(dirname(__FILE__));
     wp_enqueue_script('mb-show-hide', $url . 'show-hide.js', array('jquery'), '1.0.2', true);
 }