@@ -41,6 +41,6 @@ |
||
41 | 41 | * |
42 | 42 | * @return array|string Return Mapped data. |
43 | 43 | */ |
44 | - public function transform_data( $data, $jsonld, &$references, $post_id ); |
|
44 | + public function transform_data($data, $jsonld, &$references, $post_id); |
|
45 | 45 | |
46 | 46 | } |
@@ -15,32 +15,32 @@ |
||
15 | 15 | */ |
16 | 16 | interface Mappings_Transform_Function { |
17 | 17 | |
18 | - /** |
|
19 | - * Returns unique name of the transform function. |
|
20 | - * |
|
21 | - * @return string $name Unique name of the transform function, it should not be repeated |
|
22 | - * for any other transform function. |
|
23 | - */ |
|
24 | - public function get_name(); |
|
18 | + /** |
|
19 | + * Returns unique name of the transform function. |
|
20 | + * |
|
21 | + * @return string $name Unique name of the transform function, it should not be repeated |
|
22 | + * for any other transform function. |
|
23 | + */ |
|
24 | + public function get_name(); |
|
25 | 25 | |
26 | - /** |
|
27 | - * Returns label of the transform function. |
|
28 | - * |
|
29 | - * @return string $label Label of the transform function to be used in UI, need not |
|
30 | - * be unique. |
|
31 | - */ |
|
32 | - public function get_label(); |
|
26 | + /** |
|
27 | + * Returns label of the transform function. |
|
28 | + * |
|
29 | + * @return string $label Label of the transform function to be used in UI, need not |
|
30 | + * be unique. |
|
31 | + */ |
|
32 | + public function get_label(); |
|
33 | 33 | |
34 | - /** |
|
35 | - * Transform data and map to the desired keys. |
|
36 | - * |
|
37 | - * @param array|string $data An Associative Array containing raw data or string. |
|
38 | - * @param array $jsonld The JSON-LD structure. |
|
39 | - * @param int[] $references An array of post IDs referenced by the JSON-LD structure. |
|
40 | - * @param int $post_id The post ID. |
|
41 | - * |
|
42 | - * @return array|string Return Mapped data. |
|
43 | - */ |
|
44 | - public function transform_data( $data, $jsonld, &$references, $post_id ); |
|
34 | + /** |
|
35 | + * Transform data and map to the desired keys. |
|
36 | + * |
|
37 | + * @param array|string $data An Associative Array containing raw data or string. |
|
38 | + * @param array $jsonld The JSON-LD structure. |
|
39 | + * @param int[] $references An array of post IDs referenced by the JSON-LD structure. |
|
40 | + * @param int $post_id The post ID. |
|
41 | + * |
|
42 | + * @return array|string Return Mapped data. |
|
43 | + */ |
|
44 | + public function transform_data( $data, $jsonld, &$references, $post_id ); |
|
45 | 45 | |
46 | 46 | } |
@@ -4,29 +4,29 @@ |
||
4 | 4 | |
5 | 5 | class Task_Ajax_Adapters_Registry { |
6 | 6 | |
7 | - private $task_ajax_adapters = array(); |
|
7 | + private $task_ajax_adapters = array(); |
|
8 | 8 | |
9 | - public function __construct( $adapters = array() ) { |
|
9 | + public function __construct( $adapters = array() ) { |
|
10 | 10 | |
11 | - $this->task_ajax_adapters = is_array( $adapters ) ? $adapters : array( $adapters ); |
|
11 | + $this->task_ajax_adapters = is_array( $adapters ) ? $adapters : array( $adapters ); |
|
12 | 12 | |
13 | - } |
|
13 | + } |
|
14 | 14 | |
15 | - /** |
|
16 | - * @param Task_Ajax_Adapter $task_ajax_adapter |
|
17 | - */ |
|
18 | - public function register( $task_ajax_adapter ) { |
|
15 | + /** |
|
16 | + * @param Task_Ajax_Adapter $task_ajax_adapter |
|
17 | + */ |
|
18 | + public function register( $task_ajax_adapter ) { |
|
19 | 19 | |
20 | - $this->task_ajax_adapters[] = $task_ajax_adapter; |
|
20 | + $this->task_ajax_adapters[] = $task_ajax_adapter; |
|
21 | 21 | |
22 | - } |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * @return Task_Ajax_Adapter[] |
|
26 | - */ |
|
27 | - public function get_task_ajax_adapters() { |
|
24 | + /** |
|
25 | + * @return Task_Ajax_Adapter[] |
|
26 | + */ |
|
27 | + public function get_task_ajax_adapters() { |
|
28 | 28 | |
29 | - return $this->task_ajax_adapters; |
|
30 | - } |
|
29 | + return $this->task_ajax_adapters; |
|
30 | + } |
|
31 | 31 | |
32 | 32 | } |
@@ -6,16 +6,16 @@ |
||
6 | 6 | |
7 | 7 | private $task_ajax_adapters = array(); |
8 | 8 | |
9 | - public function __construct( $adapters = array() ) { |
|
9 | + public function __construct($adapters = array()) { |
|
10 | 10 | |
11 | - $this->task_ajax_adapters = is_array( $adapters ) ? $adapters : array( $adapters ); |
|
11 | + $this->task_ajax_adapters = is_array($adapters) ? $adapters : array($adapters); |
|
12 | 12 | |
13 | 13 | } |
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param Task_Ajax_Adapter $task_ajax_adapter |
17 | 17 | */ |
18 | - public function register( $task_ajax_adapter ) { |
|
18 | + public function register($task_ajax_adapter) { |
|
19 | 19 | |
20 | 20 | $this->task_ajax_adapters[] = $task_ajax_adapter; |
21 | 21 |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | interface Page { |
6 | 6 | |
7 | - public function get_menu_slug(); |
|
7 | + public function get_menu_slug(); |
|
8 | 8 | |
9 | 9 | } |
@@ -12,13 +12,13 @@ |
||
12 | 12 | $wl_version = Wordlift::get_instance()->get_version(); |
13 | 13 | |
14 | 14 | // Get the WP version. |
15 | - $wp_version = get_bloginfo( 'version' ); |
|
15 | + $wp_version = get_bloginfo('version'); |
|
16 | 16 | |
17 | 17 | // Get the home url. |
18 | - $home_url = home_url( '/' ); |
|
18 | + $home_url = home_url('/'); |
|
19 | 19 | |
20 | 20 | // Get the locale flag. |
21 | - $locale = apply_filters( 'core_version_check_locale', get_locale() ); |
|
21 | + $locale = apply_filters('core_version_check_locale', get_locale()); |
|
22 | 22 | |
23 | 23 | // Get the multisite flag. |
24 | 24 | $multisite = is_multisite() ? 'yes' : 'no'; |
@@ -6,28 +6,28 @@ |
||
6 | 6 | |
7 | 7 | class User_Agent { |
8 | 8 | |
9 | - public static function get_user_agent() { |
|
9 | + public static function get_user_agent() { |
|
10 | 10 | |
11 | - // Get WL version. |
|
12 | - $wl_version = Wordlift::get_instance()->get_version(); |
|
11 | + // Get WL version. |
|
12 | + $wl_version = Wordlift::get_instance()->get_version(); |
|
13 | 13 | |
14 | - // Get the WP version. |
|
15 | - $wp_version = get_bloginfo( 'version' ); |
|
14 | + // Get the WP version. |
|
15 | + $wp_version = get_bloginfo( 'version' ); |
|
16 | 16 | |
17 | - // Get the home url. |
|
18 | - $home_url = home_url( '/' ); |
|
17 | + // Get the home url. |
|
18 | + $home_url = home_url( '/' ); |
|
19 | 19 | |
20 | - // Get the locale flag. |
|
21 | - $locale = apply_filters( 'core_version_check_locale', get_locale() ); |
|
20 | + // Get the locale flag. |
|
21 | + $locale = apply_filters( 'core_version_check_locale', get_locale() ); |
|
22 | 22 | |
23 | - // Get the multisite flag. |
|
24 | - $multisite = is_multisite() ? 'yes' : 'no'; |
|
23 | + // Get the multisite flag. |
|
24 | + $multisite = is_multisite() ? 'yes' : 'no'; |
|
25 | 25 | |
26 | - // Get the PHP version. |
|
27 | - $php_version = phpversion(); |
|
26 | + // Get the PHP version. |
|
27 | + $php_version = phpversion(); |
|
28 | 28 | |
29 | - /** @var string $wp_version The variable is defined in `version.php`. */ |
|
30 | - return "WordLift/$wl_version WordPress/$wp_version (multisite:$multisite, url:$home_url, locale:$locale) PHP/$php_version"; |
|
31 | - } |
|
29 | + /** @var string $wp_version The variable is defined in `version.php`. */ |
|
30 | + return "WordLift/$wl_version WordPress/$wp_version (multisite:$multisite, url:$home_url, locale:$locale) PHP/$php_version"; |
|
31 | + } |
|
32 | 32 | |
33 | 33 | } |
@@ -20,80 +20,80 @@ |
||
20 | 20 | */ |
21 | 21 | class Wordlift_WpRocket_Adapter { |
22 | 22 | |
23 | - /** |
|
24 | - * Create a {@link Wordlift_WpRocket_Adapter} instance. |
|
25 | - * |
|
26 | - * @since 3.19.4 |
|
27 | - */ |
|
28 | - public function __construct() { |
|
23 | + /** |
|
24 | + * Create a {@link Wordlift_WpRocket_Adapter} instance. |
|
25 | + * |
|
26 | + * @since 3.19.4 |
|
27 | + */ |
|
28 | + public function __construct() { |
|
29 | 29 | |
30 | - add_filter( 'rocket_exclude_js', array( $this, 'exclude_js' ) ); |
|
31 | - add_filter( 'rocket_excluded_inline_js_content', array( $this, 'excluded_inline_js_content' ) ); |
|
30 | + add_filter( 'rocket_exclude_js', array( $this, 'exclude_js' ) ); |
|
31 | + add_filter( 'rocket_excluded_inline_js_content', array( $this, 'excluded_inline_js_content' ) ); |
|
32 | 32 | |
33 | - } |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * Get the absolute path for the specified URL. |
|
37 | - * |
|
38 | - * @param string $url The full URL. |
|
39 | - * |
|
40 | - * @return string The absolute path. |
|
41 | - */ |
|
42 | - private function get_absolute_path( $url ) { |
|
35 | + /** |
|
36 | + * Get the absolute path for the specified URL. |
|
37 | + * |
|
38 | + * @param string $url The full URL. |
|
39 | + * |
|
40 | + * @return string The absolute path. |
|
41 | + */ |
|
42 | + private function get_absolute_path( $url ) { |
|
43 | 43 | |
44 | - if ( 1 !== preg_match( '|https?://[^/]+(/.*)$|', $url, $matches ) ) { |
|
45 | - return $url; |
|
46 | - } |
|
44 | + if ( 1 !== preg_match( '|https?://[^/]+(/.*)$|', $url, $matches ) ) { |
|
45 | + return $url; |
|
46 | + } |
|
47 | 47 | |
48 | - return $matches[1]; |
|
49 | - } |
|
48 | + return $matches[1]; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * Hook to `rocket_exclude_defer_js` filter. |
|
53 | - * |
|
54 | - * @param array $excluded_js The preset excluded files. |
|
55 | - * |
|
56 | - * @return array The updated excluded files array. |
|
57 | - * |
|
58 | - * @since 3.25.0 We realized that WP Rocket has an issue with these path: while it seems to expect a path relative |
|
59 | - * to home_url, it is actually looking for a path relative to the root. We leave both exclusions so |
|
60 | - * that we'll be compatible in case WP Rocket fixes its implementation. |
|
61 | - * @since 3.23.0 add the Cloud js. |
|
62 | - * @since 3.20.0 hook to `rocket_exclude_js`. |
|
63 | - * @since 3.19.4 |
|
64 | - */ |
|
65 | - public function exclude_js( $excluded_js = array() ) { |
|
51 | + /** |
|
52 | + * Hook to `rocket_exclude_defer_js` filter. |
|
53 | + * |
|
54 | + * @param array $excluded_js The preset excluded files. |
|
55 | + * |
|
56 | + * @return array The updated excluded files array. |
|
57 | + * |
|
58 | + * @since 3.25.0 We realized that WP Rocket has an issue with these path: while it seems to expect a path relative |
|
59 | + * to home_url, it is actually looking for a path relative to the root. We leave both exclusions so |
|
60 | + * that we'll be compatible in case WP Rocket fixes its implementation. |
|
61 | + * @since 3.23.0 add the Cloud js. |
|
62 | + * @since 3.20.0 hook to `rocket_exclude_js`. |
|
63 | + * @since 3.19.4 |
|
64 | + */ |
|
65 | + public function exclude_js( $excluded_js = array() ) { |
|
66 | 66 | |
67 | - // Exclude our own public JS. |
|
68 | - $excluded_js[] = $this->get_absolute_path( Wordlift_Public::get_public_js_url() ); |
|
69 | - $excluded_js[] = $this->get_absolute_path( Wordlift_Public::get_cloud_js_url() ); |
|
67 | + // Exclude our own public JS. |
|
68 | + $excluded_js[] = $this->get_absolute_path( Wordlift_Public::get_public_js_url() ); |
|
69 | + $excluded_js[] = $this->get_absolute_path( Wordlift_Public::get_cloud_js_url() ); |
|
70 | 70 | |
71 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/wordlift/js/dist/bundle.js' ) ); |
|
72 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/wordlift/js/dist/wordlift-cloud.js' ) ); |
|
71 | + $excluded_js[] = str_replace( home_url(), '', plugins_url( '/wordlift/js/dist/bundle.js' ) ); |
|
72 | + $excluded_js[] = str_replace( home_url(), '', plugins_url( '/wordlift/js/dist/wordlift-cloud.js' ) ); |
|
73 | 73 | |
74 | - return $excluded_js; |
|
75 | - } |
|
74 | + return $excluded_js; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * Filters inline JS excluded from being combined |
|
79 | - * |
|
80 | - * @link https://github.com/insideout10/wordlift-plugin/issues/868 |
|
81 | - * |
|
82 | - * @since 3.20.0 |
|
83 | - * |
|
84 | - * @param array $pattern Patterns to match. |
|
85 | - * |
|
86 | - * @return array Patterns to match. |
|
87 | - */ |
|
88 | - public function excluded_inline_js_content( $pattern = array() ) { |
|
77 | + /** |
|
78 | + * Filters inline JS excluded from being combined |
|
79 | + * |
|
80 | + * @link https://github.com/insideout10/wordlift-plugin/issues/868 |
|
81 | + * |
|
82 | + * @since 3.20.0 |
|
83 | + * |
|
84 | + * @param array $pattern Patterns to match. |
|
85 | + * |
|
86 | + * @return array Patterns to match. |
|
87 | + */ |
|
88 | + public function excluded_inline_js_content( $pattern = array() ) { |
|
89 | 89 | |
90 | - $pattern[] = 'wlSettings'; |
|
91 | - $pattern[] = 'wlNavigators'; |
|
92 | - $pattern[] = '_wlCloudSettings'; |
|
93 | - $pattern[] = 'wlProductsNavigators'; |
|
94 | - $pattern[] = 'wlFaceteds'; |
|
90 | + $pattern[] = 'wlSettings'; |
|
91 | + $pattern[] = 'wlNavigators'; |
|
92 | + $pattern[] = '_wlCloudSettings'; |
|
93 | + $pattern[] = 'wlProductsNavigators'; |
|
94 | + $pattern[] = 'wlFaceteds'; |
|
95 | 95 | |
96 | - return $pattern; |
|
97 | - } |
|
96 | + return $pattern; |
|
97 | + } |
|
98 | 98 | |
99 | 99 | } |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | 29 | |
30 | - add_filter( 'rocket_exclude_js', array( $this, 'exclude_js' ) ); |
|
31 | - add_filter( 'rocket_excluded_inline_js_content', array( $this, 'excluded_inline_js_content' ) ); |
|
30 | + add_filter('rocket_exclude_js', array($this, 'exclude_js')); |
|
31 | + add_filter('rocket_excluded_inline_js_content', array($this, 'excluded_inline_js_content')); |
|
32 | 32 | |
33 | 33 | } |
34 | 34 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @return string The absolute path. |
41 | 41 | */ |
42 | - private function get_absolute_path( $url ) { |
|
42 | + private function get_absolute_path($url) { |
|
43 | 43 | |
44 | - if ( 1 !== preg_match( '|https?://[^/]+(/.*)$|', $url, $matches ) ) { |
|
44 | + if (1 !== preg_match('|https?://[^/]+(/.*)$|', $url, $matches)) { |
|
45 | 45 | return $url; |
46 | 46 | } |
47 | 47 | |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | * @since 3.20.0 hook to `rocket_exclude_js`. |
63 | 63 | * @since 3.19.4 |
64 | 64 | */ |
65 | - public function exclude_js( $excluded_js = array() ) { |
|
65 | + public function exclude_js($excluded_js = array()) { |
|
66 | 66 | |
67 | 67 | // Exclude our own public JS. |
68 | - $excluded_js[] = $this->get_absolute_path( Wordlift_Public::get_public_js_url() ); |
|
69 | - $excluded_js[] = $this->get_absolute_path( Wordlift_Public::get_cloud_js_url() ); |
|
68 | + $excluded_js[] = $this->get_absolute_path(Wordlift_Public::get_public_js_url()); |
|
69 | + $excluded_js[] = $this->get_absolute_path(Wordlift_Public::get_cloud_js_url()); |
|
70 | 70 | |
71 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/wordlift/js/dist/bundle.js' ) ); |
|
72 | - $excluded_js[] = str_replace( home_url(), '', plugins_url( '/wordlift/js/dist/wordlift-cloud.js' ) ); |
|
71 | + $excluded_js[] = str_replace(home_url(), '', plugins_url('/wordlift/js/dist/bundle.js')); |
|
72 | + $excluded_js[] = str_replace(home_url(), '', plugins_url('/wordlift/js/dist/wordlift-cloud.js')); |
|
73 | 73 | |
74 | 74 | return $excluded_js; |
75 | 75 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return array Patterns to match. |
87 | 87 | */ |
88 | - public function excluded_inline_js_content( $pattern = array() ) { |
|
88 | + public function excluded_inline_js_content($pattern = array()) { |
|
89 | 89 | |
90 | 90 | $pattern[] = 'wlSettings'; |
91 | 91 | $pattern[] = 'wlNavigators'; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @since 3.8.0 |
47 | 47 | */ |
48 | - public function __construct( $url, $id, $required = false ) { |
|
48 | + public function __construct($url, $id, $required = false) { |
|
49 | 49 | |
50 | 50 | $this->url = $url; |
51 | 51 | $this->id = $id; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @since 3.27.1 |
103 | 103 | */ |
104 | - public function set_required( $value ) { |
|
104 | + public function set_required($value) { |
|
105 | 105 | |
106 | 106 | $this->required = $value; |
107 | 107 |
@@ -16,93 +16,93 @@ |
||
16 | 16 | */ |
17 | 17 | class Wordlift_Property_Entity_Reference { |
18 | 18 | |
19 | - /** |
|
20 | - * The URL associated with this entity reference. |
|
21 | - * |
|
22 | - * @since 3.8.0 |
|
23 | - * @access private |
|
24 | - * @var string $url The URL associated with the entity reference. |
|
25 | - */ |
|
26 | - private $url; |
|
27 | - |
|
28 | - /** |
|
29 | - * The entity post id. |
|
30 | - * |
|
31 | - * @since 3.10.0 |
|
32 | - * @access private |
|
33 | - * @var int $id The entity post id. |
|
34 | - */ |
|
35 | - private $id; |
|
36 | - |
|
37 | - private $required; |
|
38 | - |
|
39 | - /** |
|
40 | - * Create a Wordlift_Property_Entity_Reference instance with the provided URL. |
|
41 | - * |
|
42 | - * @param string $url The URL. |
|
43 | - * @param int $id The entity post id. |
|
44 | - * @param bool $required Whether this property is always required in SD output, default false. |
|
45 | - * |
|
46 | - * @since 3.8.0 |
|
47 | - */ |
|
48 | - public function __construct( $url, $id, $required = false ) { |
|
49 | - |
|
50 | - $this->url = $url; |
|
51 | - $this->id = $id; |
|
52 | - $this->required = $required; |
|
53 | - |
|
54 | - } |
|
55 | - |
|
56 | - /** |
|
57 | - * Get the URL associated with this entity reference. |
|
58 | - * |
|
59 | - * @return string The URL associated with the entity reference. |
|
60 | - * @since 3.8.0 |
|
61 | - */ |
|
62 | - public function get_url() { |
|
63 | - |
|
64 | - return $this->url; |
|
65 | - } |
|
66 | - |
|
67 | - /** |
|
68 | - * Get the entity id. |
|
69 | - * |
|
70 | - * @return int The entity id. |
|
71 | - * @since 3.10.0 |
|
72 | - */ |
|
73 | - public function get_id() { |
|
74 | - |
|
75 | - return $this->id; |
|
76 | - } |
|
77 | - |
|
78 | - /** |
|
79 | - * Get the required flag for this {@link Wordlift_Property_Entity_Reference}. |
|
80 | - * |
|
81 | - * The required flag may tell converters or consumers (like {@link \Wordlift\Jsonld\Jsonld_Service} that this |
|
82 | - * property needs to be output to SD (JSON-LD). |
|
83 | - * |
|
84 | - * @since 3.27.1 |
|
85 | - */ |
|
86 | - public function get_required() { |
|
87 | - |
|
88 | - return $this->required; |
|
89 | - |
|
90 | - } |
|
91 | - |
|
92 | - /** |
|
93 | - * Set the required flag for this {@link Wordlift_Property_Entity_Reference}. |
|
94 | - * |
|
95 | - * The required flag may tell converters or consumers (like {@link \Wordlift\Jsonld\Jsonld_Service} that this |
|
96 | - * property needs to be output to SD (JSON-LD). |
|
97 | - * |
|
98 | - * @param bool $value |
|
99 | - * |
|
100 | - * @since 3.27.1 |
|
101 | - */ |
|
102 | - public function set_required( $value ) { |
|
103 | - |
|
104 | - $this->required = $value; |
|
105 | - |
|
106 | - } |
|
19 | + /** |
|
20 | + * The URL associated with this entity reference. |
|
21 | + * |
|
22 | + * @since 3.8.0 |
|
23 | + * @access private |
|
24 | + * @var string $url The URL associated with the entity reference. |
|
25 | + */ |
|
26 | + private $url; |
|
27 | + |
|
28 | + /** |
|
29 | + * The entity post id. |
|
30 | + * |
|
31 | + * @since 3.10.0 |
|
32 | + * @access private |
|
33 | + * @var int $id The entity post id. |
|
34 | + */ |
|
35 | + private $id; |
|
36 | + |
|
37 | + private $required; |
|
38 | + |
|
39 | + /** |
|
40 | + * Create a Wordlift_Property_Entity_Reference instance with the provided URL. |
|
41 | + * |
|
42 | + * @param string $url The URL. |
|
43 | + * @param int $id The entity post id. |
|
44 | + * @param bool $required Whether this property is always required in SD output, default false. |
|
45 | + * |
|
46 | + * @since 3.8.0 |
|
47 | + */ |
|
48 | + public function __construct( $url, $id, $required = false ) { |
|
49 | + |
|
50 | + $this->url = $url; |
|
51 | + $this->id = $id; |
|
52 | + $this->required = $required; |
|
53 | + |
|
54 | + } |
|
55 | + |
|
56 | + /** |
|
57 | + * Get the URL associated with this entity reference. |
|
58 | + * |
|
59 | + * @return string The URL associated with the entity reference. |
|
60 | + * @since 3.8.0 |
|
61 | + */ |
|
62 | + public function get_url() { |
|
63 | + |
|
64 | + return $this->url; |
|
65 | + } |
|
66 | + |
|
67 | + /** |
|
68 | + * Get the entity id. |
|
69 | + * |
|
70 | + * @return int The entity id. |
|
71 | + * @since 3.10.0 |
|
72 | + */ |
|
73 | + public function get_id() { |
|
74 | + |
|
75 | + return $this->id; |
|
76 | + } |
|
77 | + |
|
78 | + /** |
|
79 | + * Get the required flag for this {@link Wordlift_Property_Entity_Reference}. |
|
80 | + * |
|
81 | + * The required flag may tell converters or consumers (like {@link \Wordlift\Jsonld\Jsonld_Service} that this |
|
82 | + * property needs to be output to SD (JSON-LD). |
|
83 | + * |
|
84 | + * @since 3.27.1 |
|
85 | + */ |
|
86 | + public function get_required() { |
|
87 | + |
|
88 | + return $this->required; |
|
89 | + |
|
90 | + } |
|
91 | + |
|
92 | + /** |
|
93 | + * Set the required flag for this {@link Wordlift_Property_Entity_Reference}. |
|
94 | + * |
|
95 | + * The required flag may tell converters or consumers (like {@link \Wordlift\Jsonld\Jsonld_Service} that this |
|
96 | + * property needs to be output to SD (JSON-LD). |
|
97 | + * |
|
98 | + * @param bool $value |
|
99 | + * |
|
100 | + * @since 3.27.1 |
|
101 | + */ |
|
102 | + public function set_required( $value ) { |
|
103 | + |
|
104 | + $this->required = $value; |
|
105 | + |
|
106 | + } |
|
107 | 107 | |
108 | 108 | } |
@@ -12,15 +12,15 @@ |
||
12 | 12 | */ |
13 | 13 | class Wordlift_Install_3_27_1 extends Wordlift_Install { |
14 | 14 | |
15 | - /** |
|
16 | - * {@inheritdoc} |
|
17 | - */ |
|
18 | - protected static $version = '3.27.1'; |
|
15 | + /** |
|
16 | + * {@inheritdoc} |
|
17 | + */ |
|
18 | + protected static $version = '3.27.1'; |
|
19 | 19 | |
20 | - public function install() { |
|
21 | - $procedure = new Recipe_Maker_Entity_Type_Procedure(); |
|
22 | - $procedure->run_procedure(); |
|
23 | - } |
|
20 | + public function install() { |
|
21 | + $procedure = new Recipe_Maker_Entity_Type_Procedure(); |
|
22 | + $procedure->run_procedure(); |
|
23 | + } |
|
24 | 24 | |
25 | 25 | |
26 | 26 | } |
@@ -40,6 +40,6 @@ |
||
40 | 40 | * |
41 | 41 | * @return bool Whether the post passes or not the validation. |
42 | 42 | */ |
43 | - public function is_valid( $identifier, $operator, $operand_1, $operand_2, $type ); |
|
43 | + public function is_valid($identifier, $operator, $operand_1, $operand_2, $type); |
|
44 | 44 | |
45 | 45 | } |
@@ -19,27 +19,27 @@ |
||
19 | 19 | */ |
20 | 20 | interface Rule_Validator { |
21 | 21 | |
22 | - const IS_EQUAL_TO = '==='; |
|
23 | - const IS_NOT_EQUAL_TO = '!=='; |
|
22 | + const IS_EQUAL_TO = '==='; |
|
23 | + const IS_NOT_EQUAL_TO = '!=='; |
|
24 | 24 | |
25 | - /** |
|
26 | - * Get the validator label. |
|
27 | - * |
|
28 | - * @return string The validator label. |
|
29 | - */ |
|
30 | - public function get_label(); |
|
25 | + /** |
|
26 | + * Get the validator label. |
|
27 | + * |
|
28 | + * @return string The validator label. |
|
29 | + */ |
|
30 | + public function get_label(); |
|
31 | 31 | |
32 | - /** |
|
33 | - * Test whether a post passes a validation. |
|
34 | - * |
|
35 | - * @param int $identifier The post id or term id. |
|
36 | - * @param string $operator The operator. |
|
37 | - * @param string $operand_1 The first operand. |
|
38 | - * @param string $operand_2 The second operand. |
|
39 | - * @param string $type The type is either post or term. |
|
40 | - * |
|
41 | - * @return bool Whether the post passes or not the validation. |
|
42 | - */ |
|
43 | - public function is_valid( $identifier, $operator, $operand_1, $operand_2, $type ); |
|
32 | + /** |
|
33 | + * Test whether a post passes a validation. |
|
34 | + * |
|
35 | + * @param int $identifier The post id or term id. |
|
36 | + * @param string $operator The operator. |
|
37 | + * @param string $operand_1 The first operand. |
|
38 | + * @param string $operand_2 The second operand. |
|
39 | + * @param string $type The type is either post or term. |
|
40 | + * |
|
41 | + * @return bool Whether the post passes or not the validation. |
|
42 | + */ |
|
43 | + public function is_valid( $identifier, $operator, $operand_1, $operand_2, $type ); |
|
44 | 44 | |
45 | 45 | } |
@@ -13,6 +13,6 @@ |
||
13 | 13 | */ |
14 | 14 | interface Abstract_Data_Source { |
15 | 15 | |
16 | - public function get_data( $identifier, $property, $type ); |
|
16 | + public function get_data( $identifier, $property, $type ); |
|
17 | 17 | |
18 | 18 | } |
@@ -13,6 +13,6 @@ |
||
13 | 13 | */ |
14 | 14 | interface Abstract_Data_Source { |
15 | 15 | |
16 | - public function get_data( $identifier, $property, $type ); |
|
16 | + public function get_data($identifier, $property, $type); |
|
17 | 17 | |
18 | 18 | } |