123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <?php
- if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly
- }
- if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
- class ACF_Admin_Tool {
- /** @var string Tool name */
- var $name = '';
- /** @var string Tool title */
- var $title = '';
- /** @var string Dashicon slug */
- // var $icon = '';
- /** @var boolean Redirect form to single */
- // var $redirect = false;
- /**
- * get_name
- *
- * This function will return the Tool's name
- *
- * @date 19/10/17
- * @since 5.6.3
- *
- * @param n/a
- * @return n/a
- */
- function get_name() {
- return $this->name;
- }
- /**
- * get_title
- *
- * This function will return the Tool's title
- *
- * @date 19/10/17
- * @since 5.6.3
- *
- * @param n/a
- * @return n/a
- */
- function get_title() {
- return $this->title;
- }
- /**
- * get_url
- *
- * This function will return the Tool's title
- *
- * @date 19/10/17
- * @since 5.6.3
- *
- * @param n/a
- * @return n/a
- */
- function get_url() {
- return acf_get_admin_tool_url( $this->name );
- }
- /**
- * is_active
- *
- * This function will return true if the tool is active
- *
- * @date 19/10/17
- * @since 5.6.3
- *
- * @param n/a
- * @return bool
- */
- function is_active() {
- return acf_maybe_get_GET( 'tool' ) === $this->name;
- }
- /*
- * __construct
- *
- * This function will setup the class functionality
- *
- * @type function
- * @date 27/6/17
- * @since 5.6.0
- *
- * @param n/a
- * @return n/a
- */
- function __construct() {
- // initialize
- $this->initialize();
- }
- /**
- * initialize
- *
- * This function will initialize the admin tool
- *
- * @date 10/10/17
- * @since 5.6.3
- *
- * @param n/a
- * @return n/a
- */
- function initialize() {
- /* do nothing */
- }
- /**
- * load
- *
- * This function is called during the admin page load
- *
- * @date 10/10/17
- * @since 5.6.3
- *
- * @param n/a
- * @return n/a
- */
- function load() {
- /* do nothing */
- }
- /**
- * html
- *
- * This function will output the metabox HTML
- *
- * @date 10/10/17
- * @since 5.6.3
- *
- * @param n/a
- * @return n/a
- */
- function html() {
- }
- /**
- * submit
- *
- * This function will run when the tool's form has been submit
- *
- * @date 10/10/17
- * @since 5.6.3
- *
- * @param n/a
- * @return n/a
- */
- function submit() {
- }
- }
- endif; // class_exists check
|