| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The header and footer code snippets functionality of the plugin. |
| 5 |
* |
| 6 |
* |
| 7 |
* @link https://searchatlas.com |
| 8 |
* @since 1.0.0 |
| 9 |
* @package Metasync |
| 10 |
* @subpackage Metasync/code-snippets |
| 11 |
* @author Engineering Team <support@searchatlas.com> |
| 12 |
*/ |
| 13 |
|
| 14 |
// Abort if this file is accessed directly. |
| 15 |
if (!defined('ABSPATH')) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
class Metasync_Code_Snippets |
| 20 |
{ |
| 21 |
|
| 22 |
/** |
| 23 |
* Get Header Code Snippet. |
| 24 |
* |
| 25 |
*/ |
| 26 |
public function get_header_snippet() |
| 27 |
{ |
| 28 |
$code_snippet_options = get_option(Metasync::option_name)['codesnippets'] ?? ''; |
| 29 |
$header_snippet_option = $code_snippet_options['header_snippet'] ?? ''; |
| 30 |
echo $header_snippet_option; |
| 31 |
echo get_post_meta(get_the_ID())['custom_post_header'][0] ?? ''; |
| 32 |
echo get_post_meta(get_the_ID())['searchatlas_embed_top'][0] ?? ''; |
| 33 |
|
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Get Footer Code Snippet. |
| 38 |
* |
| 39 |
*/ |
| 40 |
public function get_footer_snippet() |
| 41 |
{ |
| 42 |
$code_snippet_options = get_option(Metasync::option_name)['codesnippets'] ?? ''; |
| 43 |
$footer_snippet_option = $code_snippet_options['footer_snippet'] ?? ''; |
| 44 |
echo $footer_snippet_option; |
| 45 |
echo get_post_meta(get_the_ID())['custom_post_footer'][0] ?? ''; |
| 46 |
echo get_post_meta(get_the_ID())['searchatlas_embed_bottom'][0] ?? ''; |
| 47 |
} |
| 48 |
} |
| 49 |
|