| @@ -1,60 +1,65 @@ | ||
| 1 | -<?php do_action( 'betterdocs_doc_category_update_form_before', $term );?> | |
| 1 | +<?php | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | + exit; | |
| 4 | +} | |
| 5 | +do_action( 'betterdocs_doc_category_update_form_before', $term ); ?> | |
| 2 | 6 | <tr class="form-field term-group-wrap"> |
| 3 | - <th scope="row"> | |
| 4 | - <label for="doc-category-id"><?php _e( 'Category Id', 'betterdocs' );?></label> | |
| 5 | - </th> | |
| 6 | - <td> | |
| 7 | - <input | |
| 8 | - type="text" | |
| 9 | - id="doc-category-id" | |
| 10 | - style="width:100px" | |
| 11 | - name="" | |
| 12 | - readonly | |
| 13 | - value="<?php esc_attr_e( $_GET["tag_ID"] )?>" | |
| 14 | - /> | |
| 15 | - </td> | |
| 7 | + <th scope="row"> | |
| 8 | + <label for="doc-category-id"><?php esc_html_e( 'Category Id', 'betterdocs' ); ?></label> | |
| 9 | + </th> | |
| 10 | + <td> | |
| 11 | + <input | |
| 12 | + type="text" | |
| 13 | + id="doc-category-id" | |
| 14 | + style="width:100px" | |
| 15 | + name="" | |
| 16 | + readonly | |
| 17 | + value="<?php echo esc_attr( $_GET["tag_ID"] ); // phpcs:ignore ?>" | |
| 18 | + /> | |
| 19 | + </td> | |
| 16 | 20 | </tr> |
| 17 | 21 | <tr class="form-field term-group-wrap"> |
| 18 | - <th scope="row"> | |
| 19 | - <label for="doc-category-order"><?php _e( 'Order', 'betterdocs' );?></label> | |
| 20 | - </th> | |
| 21 | - <td> | |
| 22 | - <input type="number" id="doc-category-order" style="width:100px" name="term_meta[order]" value="<?php echo $order ? esc_attr( $order ) : ''; ?>"> | |
| 23 | - </td> | |
| 22 | + <th scope="row"> | |
| 23 | + <label for="doc-category-order"><?php esc_html_e( 'Order', 'betterdocs' ); ?></label> | |
| 24 | + </th> | |
| 25 | + <td> | |
| 26 | + <input type="number" id="doc-category-order" style="width:100px" name="term_meta[order]" value="<?php echo $order ? esc_attr( $order ) : ''; ?>"> | |
| 27 | + </td> | |
| 24 | 28 | </tr> |
| 25 | 29 | <tr class="form-field term-group-wrap batterdocs-cat-media-upload"> |
| 26 | - <th scope="row"> | |
| 27 | - <label><?php _e( 'Category Icon', 'betterdocs' );?></label> | |
| 28 | - </th> | |
| 29 | - <td> | |
| 30 | - <input type="hidden" class="doc-category-image-id" name="term_meta[image-id]" value="<?php esc_attr_e( $icon_id );?>"> | |
| 31 | - <div class="doc-category-image-wrapper" id="doc-category-image-wrapper"> | |
| 32 | - <?php | |
| 33 | - if ( $icon_id ) { | |
| 34 | - echo '<img style="display: none;" src="' . betterdocs()->assets->icon( 'betterdocs-cat-icon.svg', true ) . '" alt="">'; | |
| 35 | - echo wp_get_attachment_image( $icon_id, 'thumbnail', false, 'class=custom_media_image' ); | |
| 36 | - } else { | |
| 37 | - echo '<img src="' . betterdocs()->assets->icon( 'betterdocs-cat-icon.svg', true ) . '" alt="">'; | |
| 38 | - } | |
| 39 | - ?> | |
| 30 | + <th scope="row"> | |
| 31 | + <label><?php esc_html_e( 'Category Icon', 'betterdocs' ); ?></label> | |
| 32 | + </th> | |
| 33 | + <td> | |
| 34 | + <input type="hidden" class="doc-category-image-id" name="term_meta[image-id]" value="<?php echo esc_attr( $icon_id ); ?>"> | |
| 35 | + <div class="doc-category-image-wrapper" id="doc-category-image-wrapper"> | |
| 36 | + <?php | |
| 37 | + if ( $icon_id ) { | |
| 38 | + echo '<img style="display: none;" src="' . betterdocs()->assets->icon( 'betterdocs-cat-icon.svg', true ) . '" alt="">'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Outputs Html Icon | |
| 39 | + echo wp_get_attachment_image( $icon_id, 'thumbnail', false, 'class=custom_media_image' ); | |
| 40 | + } else { | |
| 41 | + echo '<img src="' . betterdocs()->assets->icon( 'betterdocs-cat-icon.svg', true ) . '" alt="">'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Outputs Html Icon | |
| 42 | + } | |
| 43 | + ?> | |
| 40 | 44 | |
| 41 | - </div> | |
| 42 | - <p> | |
| 43 | - <input | |
| 44 | - type="button" | |
| 45 | - class="button button-secondary betterdocs_tax_media_button" | |
| 46 | - id="betterdocs_tax_media_button" | |
| 47 | - name="betterdocs_tax_media_button" | |
| 48 | - value="<?php _e( 'Add Image', 'betterdocs' );?>" | |
| 49 | - /> | |
| 50 | - <input | |
| 51 | - type="button" | |
| 52 | - class="button button-secondary doc_tax_media_remove" | |
| 53 | - id="doc_tax_media_remove" | |
| 54 | - name="doc_tax_media_remove" | |
| 55 | - value="<?php _e( 'Remove Image', 'betterdocs' );?>" | |
| 56 | - /> | |
| 57 | - </p> | |
| 58 | - </td> | |
| 45 | + </div> | |
| 46 | + <p> | |
| 47 | + <input | |
| 48 | + type="button" | |
| 49 | + class="button button-secondary betterdocs_tax_media_button" | |
| 50 | + id="betterdocs_tax_media_button" | |
| 51 | + name="betterdocs_tax_media_button" | |
| 52 | + value="<?php esc_html_e( 'Add Image', 'betterdocs' ); ?>" | |
| 53 | + /> | |
| 54 | + <input | |
| 55 | + type="button" | |
| 56 | + class="button button-secondary doc_tax_media_remove" | |
| 57 | + id="doc_tax_media_remove" | |
| 58 | + name="doc_tax_media_remove" | |
| 59 | + value="<?php esc_html_e( 'Remove Image', 'betterdocs' ); ?>" | |
| 60 | + /> | |
| 61 | + </p> | |
| 62 | + </td> | |
| 59 | 63 | </tr> |
| 60 | -<?php do_action( 'betterdocs_doc_category_update_form_after', $term ); | |
| 64 | +<?php | |
| 65 | +do_action( 'betterdocs_doc_category_update_form_after', $term ); | |