Skip to content

Commit 27c67a8

Browse files
committed
Moved and methods to wordpress-toolkit
1 parent ad777b8 commit 27c67a8

2 files changed

Lines changed: 3 additions & 26 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ Release changes are noted on the [Releases](https://github.com/dmhendricks/wordp
8585

8686
#### Branch: `master`
8787

88-
* None since release
88+
* Extended base class as WordPress Toolkit
89+
* Moved `is_ajax()` and `prefix()` methods to wordpress-toolkit
8990

9091
## Screenshot
9192

app/Plugin.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Carbon_Fields\Field;
99
use Config;
1010

11-
class Plugin {
11+
class Plugin extends \WordPress_ToolKit\ToolKit {
1212

1313
public static $textdomain;
1414
public static $config;
@@ -245,20 +245,6 @@ public static function get_wpsac_plugin_option( $key, $group_id = 'options', $ca
245245

246246
}
247247

248-
/**
249-
* A wrapper for the plugin's data fiala prefix as defined in $config
250-
*
251-
* @param string|null $field_name The string/field to prefix
252-
* @param string $before String to add before the prefix
253-
* @param string $after String to add after the prefix
254-
* @return string Prefixed string/field value
255-
* @since 0.2.0
256-
*/
257-
public static function prefix( $field_name = null, $before = '', $after = '_' ) {
258-
$prefix = $before . self::$config->get( 'prefix' ) . $after;
259-
return $field_name !== null ? $prefix . $field_name : $prefix;
260-
}
261-
262248
/**
263249
* Returns true if WP_ENV is anything other than 'development' or 'staging'.
264250
* Useful for determining whether or not to enqueue a minified or non-
@@ -271,14 +257,4 @@ public static function is_production() {
271257
return ( !defined( 'WP_ENV' ) || ( defined('WP_ENV' ) && !in_array( WP_ENV, array( 'development', 'staging' ) ) ) );
272258
}
273259

274-
/**
275-
* Returns true if request is via Ajax.
276-
*
277-
* @return bool
278-
* @since 0.1.0
279-
*/
280-
public function is_ajax() {
281-
return defined( 'DOING_AJAX' ) && DOING_AJAX;
282-
}
283-
284260
}

0 commit comments

Comments
 (0)