PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.8.5
Secure Custom Fields v6.8.5
6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / includes / ajax / class-acf-ajax-user-setting.php
secure-custom-fields / includes / ajax Last commit date
class-acf-ajax-check-screen.php 2 months ago class-acf-ajax-local-json-diff.php 1 year ago class-acf-ajax-query-users.php 3 months ago class-acf-ajax-query.php 4 months ago class-acf-ajax-upgrade.php 2 months ago class-acf-ajax-user-setting.php 1 year ago class-acf-ajax.php 1 year ago index.php 1 year ago
class-acf-ajax-user-setting.php
54 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly
5 }
6
7 if ( ! class_exists( 'ACF_Ajax_User_Setting' ) ) :
8
9 class ACF_Ajax_User_Setting extends ACF_Ajax {
10
11 /**
12 * The AJAX action name.
13 *
14 * @var string
15 */
16 public $action = 'acf/ajax/user_setting';
17
18 /**
19 * Prevents access for non-logged in users.
20 *
21 * @var boolean
22 */
23 public $public = false;
24
25 /**
26 * get_response
27 *
28 * Returns the response data to sent back.
29 *
30 * @date 31/7/18
31 * @since ACF 5.7.2
32 *
33 * @param array $request The request args.
34 * @return mixed The response data or WP_Error.
35 */
36 public function get_response( $request ) {
37 if ( ! acf_current_user_can_admin() ) {
38 return new WP_Error( 'acf_invalid_permissions', __( 'Sorry, you do not have permission to do that.', 'secure-custom-fields' ) );
39 }
40
41 // update
42 if ( $this->has( 'value' ) ) {
43 return acf_update_user_setting( $this->get( 'name' ), $this->get( 'value' ) );
44
45 // get
46 } else {
47 return acf_get_user_setting( $this->get( 'name' ) );
48 }
49 }
50 }
51
52 acf_new_instance( 'ACF_Ajax_User_Setting' );
53 endif; // class_exists check
54