initial commit
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
echo null;
|
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Redux "My Extension" Extension Class
|
||||
* Short description.
|
||||
*
|
||||
* @package Redux Extentions
|
||||
* @class Redux_Extension_My_Extension
|
||||
* @version 1.0.0
|
||||
*
|
||||
* There is no free support for extension development.
|
||||
* This example is 'as is'.
|
||||
*
|
||||
* Please be sure to replace ALL instances of "My Extension" and "My_Extension" with the name of your actual
|
||||
* extension. Please also change the file name, so the 'my-extension' portion is also the name of your extension.
|
||||
* Please use dashes and not underscores in the filename. Please use underscores instead of dashes in the classname.
|
||||
* Thanks! :)
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// Don't duplicate me!
|
||||
if ( ! class_exists( 'Redux_Extension_My_Extension', false ) ) {
|
||||
|
||||
/**
|
||||
* Class Redux_Extension_My_Extension
|
||||
*/
|
||||
class Redux_Extension_My_Extension extends Redux_Extension_Abstract {
|
||||
/**
|
||||
* Set extension version.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $version = '1.0.0';
|
||||
|
||||
/**
|
||||
* Set the friendly name of the extension. This is for display purposes. No underscores or dashes are required.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $extension_name = 'My Extension';
|
||||
|
||||
/**
|
||||
* Set the minimum required version of Redux here (optional).
|
||||
*
|
||||
* Leave blank to require no minimum version. This allows you to specify a minimum required version of
|
||||
* Redux in the event you do not want to support older versions.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $minimum_redux_version = '4.0.0';
|
||||
|
||||
/**
|
||||
* Redux_Extension_my_extension constructor.
|
||||
*
|
||||
* @param object $parent ReduxFramework pointer.
|
||||
*/
|
||||
public function __construct( $parent ) {
|
||||
parent::__construct( $parent, __FILE__ );
|
||||
|
||||
if ( is_admin() && ! $this->is_minimum_version( $this->minimum_redux_version, self::$version, $this->extension_name ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->add_field( 'my_field' );
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
echo null;
|
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* Redux My Extension Field Class
|
||||
* Short description.
|
||||
*
|
||||
* @package Redux Extentions
|
||||
* @class Redux_Extension_My_Extension
|
||||
* @version 1.0.0
|
||||
*
|
||||
* There is no free support for extension development.
|
||||
* This example is 'as is'.
|
||||
*
|
||||
* Please be sure to replace ALL instances of "My Extension" and "My_Extension" with the name of your actual
|
||||
* extension.
|
||||
*
|
||||
* Please also change the file name, so the 'my-extension' portion is also the name of your extension.
|
||||
* Please use dashes and not underscores in the filename. Please use underscores instead of dashes in the classname.
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// Don't duplicate me!
|
||||
if ( ! class_exists( 'Redux_My_Extension', false ) ) {
|
||||
|
||||
/**
|
||||
* Main ReduxFramework_options_object class
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Redux_My_Extension extends Redux_Field {
|
||||
/**
|
||||
* Field Constructor.
|
||||
* Required - must call the parent constructor, then assign field and value to vars
|
||||
*
|
||||
* @param array $field Field array.
|
||||
* @param mixed $value Field values.
|
||||
* @param object $parent ReduxFramework pointer.
|
||||
*
|
||||
* @throws ReflectionException Construct Exception.
|
||||
*/
|
||||
public function __construct( array $field, $value, $parent ) {
|
||||
parent::__construct( $field, $value, $parent );
|
||||
|
||||
// Set default args for this field to avoid bad indexes. Change this to anything you use.
|
||||
$defaults = array(
|
||||
'options' => array(),
|
||||
'stylesheet' => '',
|
||||
'output' => true,
|
||||
'enqueue' => true,
|
||||
'enqueue_frontend' => true,
|
||||
);
|
||||
|
||||
$this->field = wp_parse_args( $this->field, $defaults );
|
||||
}
|
||||
|
||||
/**
|
||||
* Field Render Function.
|
||||
* Takes the vars and outputs the HTML for the field in the settings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function render() {
|
||||
// Render the field.
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue Function.
|
||||
* If this field requires any scripts, or css define this function and register/enqueue the scripts/css
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function enqueue() {
|
||||
wp_enqueue_script(
|
||||
'redux-my-field',
|
||||
$this->url . 'redux-my-extension.js',
|
||||
array( 'jquery', 'redux-js' ),
|
||||
Redux_Extension_My_Extension::$version,
|
||||
true
|
||||
);
|
||||
|
||||
wp_enqueue_style(
|
||||
'redux-my-field',
|
||||
$this->url . 'redux-my-extension.css',
|
||||
array(),
|
||||
Redux_Extension_my_extension::$version
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
echo null;
|
@ -0,0 +1,14 @@
|
||||
/* global jQuery, document */
|
||||
|
||||
/** Add any Javascript for your extension here. Use of this file is optional and is only for those
|
||||
* who wish to output the file CSS using a SASS compiler.
|
||||
*
|
||||
* Please be sure to rename the 'my-extension' part of the file name to the name of your extension. Pleas use
|
||||
* dashes instead of underscores.
|
||||
*/
|
||||
|
||||
$( document ).ready(
|
||||
function() {
|
||||
|
||||
}
|
||||
)( jQuery );
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Add any SASS formatted CSS necessary for your extension here. Use of this file is optional and is only for those
|
||||
* who wish to output the file CSS using a SASS compiler.
|
||||
*
|
||||
* Please be sure to rename the 'my-extension' part of the file name to the name of your extension. Pleas use
|
||||
* dashes instead of underscores.
|
||||
*/
|
Reference in New Issue
Block a user