| @@ -48,9 +48,9 @@ | ||
| 48 | 48 | // Assign Term's ID to the object. |
| 49 | 49 | $this->term_id = $term_id; |
| 50 | 50 | |
| 51 | 51 | // Get Term Meta. |
| 52 | - $meta = get_term_meta( $term_id, self::TERM_META_KEY, true ); | |
| 52 | + $meta = get_term_meta( $term_id, 'ck_default_form', true ); | |
| 53 | 53 | |
| 54 | 54 | if ( ! $meta ) { |
| 55 | 55 | // Fallback to default settings. |
| 56 | 56 | $meta = $this->get_default_settings(); |
| @@ -95,22 +95,35 @@ | ||
| 95 | 95 | * @return bool |
| 96 | 96 | */ |
| 97 | 97 | public function has_form() { |
| 98 | 98 | |
| 99 | - // Backward compat. for Terms created/edited prior to 1.9.6, where | |
| 100 | - // 'default' was used instead of zero to denote the Post / Post Type | |
| 101 | - // setting should be used for determining the Form to display. | |
| 102 | - // Using a comparison operator on 'default' will return different results in: | |
| 103 | - // PHP < 8.0: 'default' > 0 is false | |
| 104 | - // PHP 8.0+: 'default' > 0 is true | |
| 105 | - // See https://www.php.net/manual/en/language.operators.comparison.php. | |
| 106 | - if ( $this->settings === 'default' ) { | |
| 107 | - return false; | |
| 108 | - } | |
| 99 | + return ( $this->settings > 0 ); | |
| 109 | 100 | |
| 110 | - // If the setting is greater than zero, it's a specific Form ID that | |
| 111 | - // should be used for Posts assigned to this Category. | |
| 112 | - return ( $this->settings > 0 ); | |
| 101 | + } | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * Whether the Term is set to use the Plugin's Default Form Setting. | |
| 105 | + * | |
| 106 | + * @since 1.9.6 | |
| 107 | + * | |
| 108 | + * @return bool | |
| 109 | + */ | |
| 110 | + public function uses_default_form() { | |
| 111 | + | |
| 112 | + return ( $this->settings === '-1' ); | |
| 113 | + | |
| 114 | + } | |
| 115 | + | |
| 116 | + /** | |
| 117 | + * Whether the Term is set to use NO Form. | |
| 118 | + * | |
| 119 | + * @since 1.9.6 | |
| 120 | + * | |
| 121 | + * @return bool | |
| 122 | + */ | |
| 123 | + public function uses_no_form() { | |
| 124 | + | |
| 125 | + return ( $this->settings === '0' ); | |
| 113 | 126 | |
| 114 | 127 | } |
| 115 | 128 | |
| 116 | 129 | /** |