| 1 |
<?php |
| 2 |
require_once __DIR__ . '/functions.php'; |
| 3 |
|
| 4 |
/* Begin Add Assets */ |
| 5 |
add_action( 'wp_insert_modules_js', 'wp_insert_module_trackingcodes_js', 0 ); |
| 6 |
function wp_insert_module_trackingcodes_js() { |
| 7 |
wp_register_script( 'wp-insert-module-trackingcodes-js', WP_INSERT_URL . 'includes/modules/general/trackingcodes/js/module.js', [ 'wp-insert-js' ], WP_INSERT_VERSION . ( ( WP_INSERT_DEBUG ) ? wp_rand( 0, 9999 ) : '' ), true ); |
| 8 |
wp_enqueue_script( 'wp-insert-module-trackingcodes-js' ); |
| 9 |
} |
| 10 |
/* End Add Assets */ |
| 11 |
|
| 12 |
/* Begin Add Card in Admin Panel */ |
| 13 |
add_action( 'wp_insert_plugin_card', 'wp_insert_trackingcodes_plugin_card', 80 ); |
| 14 |
function wp_insert_trackingcodes_plugin_card() { |
| 15 |
echo '<div class="plugin-card">'; |
| 16 |
echo '<div class="plugin-card-top">'; |
| 17 |
echo '<h4>Tracking Codes</h4>'; |
| 18 |
echo '<p>Google Analytics and other embeddable codes directly inserted into the site.</p>'; |
| 19 |
echo '</div>'; |
| 20 |
echo '<div class="plugin-card-bottom">'; |
| 21 |
echo '<p><a id="wp_insert_trackingcodes_google_analytics" href="javascript:;">Google Analytics</a></p>'; |
| 22 |
echo '<p><a id="wp_insert_trackingcodes_header" href="javascript:;">Embed Code in Header</a></p>'; |
| 23 |
echo '<p><a id="wp_insert_trackingcodes_footer" href="javascript:;">Embed Code in Footer</a></p>'; |
| 24 |
echo '</div>'; |
| 25 |
echo '</div>'; |
| 26 |
} |
| 27 |
/* End Add Card in Admin Panel */ |
| 28 |
|