1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- if ( ! defined( 'ABSPATH' ) ) {
- exit;
- }
- if ( ! class_exists( 'ACF_Location_Comment' ) ) :
- class ACF_Location_Comment extends ACF_Location {
-
- public function initialize() {
- $this->name = 'comment';
- $this->label = __( 'Comment', 'acf' );
- $this->category = 'forms';
- $this->object_type = 'comment';
- }
-
- public function match( $rule, $screen, $field_group ) {
-
- if ( isset( $screen['comment'] ) ) {
- $comment = $screen['comment'];
- } else {
- return false;
- }
- return $this->compare_to_rule( $comment, $rule );
- }
-
- public function get_values( $rule ) {
- return array_merge(
- array(
- 'all' => __( 'All', 'acf' ),
- ),
- acf_get_pretty_post_types()
- );
- }
- }
-
- acf_register_location_type( 'ACF_Location_Comment' );
- endif;
|