| 1 |
<?php |
| 2 |
/* |
| 3 |
* Page Name: Scripts & Styles |
| 4 |
*/ |
| 5 |
|
| 6 |
use WPCoder\Dashboard\Field; |
| 7 |
use WPCoder\Dashboard\Option; |
| 8 |
|
| 9 |
defined( 'ABSPATH' ) || exit; |
| 10 |
|
| 11 |
$default = Field::getDefault(); |
| 12 |
$opt = include( 'options/includes.php' ); |
| 13 |
$count = ! empty( $default['param']['include'] ) ? count( $default['param']['include'] ) : 0; |
| 14 |
?> |
| 15 |
|
| 16 |
<fieldset id="includes-files" class="wowp-fieldset"> |
| 17 |
<div class="wowp-fieldset__header"> |
| 18 |
<div class="wowp-fieldset__header-title"> |
| 19 |
<?php esc_html_e( 'Add External Scripts & Styles', 'wp-coder' ); ?> |
| 20 |
<p>Add custom styles or scripts to your site by entering the URL. These files will be loaded on the front end.</p> |
| 21 |
</div> |
| 22 |
|
| 23 |
<div class="wowp-fieldset__header-button"> |
| 24 |
<a class="button button-secondary" id="add-include"><?php esc_html_e( 'Add New', 'wp-coder' ); ?></a> |
| 25 |
</div> |
| 26 |
</div> |
| 27 |
|
| 28 |
<?php if ( $count > 0 ) : |
| 29 |
for ( $i = 0; $i < $count; $i ++ ): |
| 30 |
?> |
| 31 |
|
| 32 |
<div class="wowp-fields__group"> |
| 33 |
<button class="wowp-button__icon is-remove dashicons dashicons-trash"></button> |
| 34 |
<?php Option::init( [ |
| 35 |
$opt['include'], |
| 36 |
$opt['include_file'], |
| 37 |
$opt['js_attr'], |
| 38 |
], $i ); ?> |
| 39 |
|
| 40 |
</div> |
| 41 |
<?php |
| 42 |
endfor; |
| 43 |
endif; ?> |
| 44 |
|
| 45 |
<div class="btn-add-display"></div> |
| 46 |
</fieldset> |
| 47 |
|
| 48 |
|
| 49 |
<template id="clone-includes"> |
| 50 |
|
| 51 |
<div class="wowp-fields__group"> |
| 52 |
<button class="wowp-button__icon is-remove dashicons dashicons-trash"></button> |
| 53 |
<?php Option::init( [ |
| 54 |
$opt['include'], |
| 55 |
$opt['include_file'], |
| 56 |
$opt['js_attr'], |
| 57 |
], - 1 ); ?> |
| 58 |
|
| 59 |
</div> |
| 60 |
|
| 61 |
</template> |
| 62 |
|
| 63 |
|
| 64 |
<?php |
| 65 |
|