| @@ -84,11 +84,8 @@ | ||
| 84 | 84 | |
| 85 | 85 | // Enqueue Category CSS. |
| 86 | 86 | wp_enqueue_style( 'convertkit-category', CONVERTKIT_PLUGIN_URL . 'resources/backend/css/category.css', array(), CONVERTKIT_PLUGIN_VERSION ); |
| 87 | 87 | |
| 88 | - // Enqueue Refresh Resources CSS. | |
| 89 | - wp_enqueue_style( 'convertkit-admin-refresh-resources', CONVERTKIT_PLUGIN_URL . 'resources/backend/css/refresh-resources.css', array(), CONVERTKIT_PLUGIN_VERSION ); | |
| 90 | - | |
| 91 | 88 | /** |
| 92 | 89 | * Enqueue CSS when editing a Category that outputs |
| 93 | 90 | * ConvertKit Plugin settings. |
| 94 | 91 | * |
| @@ -113,12 +110,17 @@ | ||
| 113 | 110 | return false; |
| 114 | 111 | } |
| 115 | 112 | |
| 116 | 113 | // Bail if we are not editing a Category. |
| 117 | - if ( convertkit_get_current_screen( 'id' ) !== 'edit-category' ) { | |
| 114 | + if ( ! function_exists( 'get_current_screen' ) ) { | |
| 118 | 115 | return false; |
| 119 | 116 | } |
| 117 | + $screen = get_current_screen(); | |
| 120 | 118 | |
| 119 | + if ( $screen->id !== 'edit-category' ) { | |
| 120 | + return false; | |
| 121 | + } | |
| 122 | + | |
| 121 | 123 | // Bail if the API hasn't been configured. |
| 122 | 124 | $settings = new ConvertKit_Settings(); |
| 123 | 125 | if ( ! $settings->has_access_and_refresh_token() ) { |
| 124 | 126 | return false; |
| @@ -180,13 +182,8 @@ | ||
| 180 | 182 | * @param int $term_id Term ID. |
| 181 | 183 | */ |
| 182 | 184 | public function save_category_fields( $term_id ) { |
| 183 | 185 | |
| 184 | - // Bail if the current user cannot edit this Category. | |
| 185 | - if ( ! current_user_can( 'edit_term', $term_id ) ) { | |
| 186 | - return; | |
| 187 | - } | |
| 188 | - | |
| 189 | 186 | // Bail if no nonce field exists. |
| 190 | 187 | if ( ! isset( $_POST['wp-convertkit-save-meta-nonce'] ) ) { |
| 191 | 188 | return; |
| 192 | 189 | } |
| @@ -203,9 +200,9 @@ | ||
| 203 | 200 | |
| 204 | 201 | // Build metadata. |
| 205 | 202 | $meta = array( |
| 206 | 203 | 'form' => ( isset( $_POST['wp-convertkit']['form'] ) ? intval( $_POST['wp-convertkit']['form'] ) : '' ), |
| 207 | - 'form_position' => ( isset( $_POST['wp-convertkit']['form_position'] ) ? sanitize_text_field( wp_unslash( $_POST['wp-convertkit']['form_position'] ) ) : '' ), | |
| 204 | + 'form_position' => ( isset( $_POST['wp-convertkit']['form_position'] ) ? $_POST['wp-convertkit']['form_position'] : '' ), | |
| 208 | 205 | ); |
| 209 | 206 | |
| 210 | 207 | // Save metadata. |
| 211 | 208 | $convertkit_term = new ConvertKit_Term( $term_id ); |