";
// ----------------------------------------------
// create button css code
// ----------------------------------------------
$phone_btn_style = '';
// dealing with button style
$phone_btn_style .= '';
// ----------------------------------------------
// add css and javascript code to header
// ----------------------------------------------
add_action( 'wp_head', function() use ($phone_btn_style, $phone_btn_exclude_option, $phone_btn_exclude_ids_array) {
$page_id = yydev_phone_btn_find_page_id();
$phone_btn_exclude_option = $phone_btn_exclude_option; // checking if we should exclude or include pages
$exclude_ids = $phone_btn_exclude_ids_array; // pages we should display on or ignore
$output_phone_button = 1;
// incase we exclude pages
if( $phone_btn_exclude_option === 'exclude' ) {
// incase we choose to exclude an id
if( in_array( $page_id, $exclude_ids) ) {
$output_phone_button = 0;
} // if( in_array( $page_id, $exclude_ids) ) {
} // if( $phone_btn_exclude_option === 'exclude' ) {
// incase we exclude pages
if( $phone_btn_exclude_option === 'include' ) {
// incase we choose to include only on some pages
if( !in_array( $page_id, $exclude_ids) ) {
$output_phone_button = 0;
} // if( !in_array( $page_id, $exclude_ids) ) {
} // if( $phone_btn_exclude_option === 'exclude' ) {
// checking if we should output the button
if( $output_phone_button ) {
// echo css code to page
echo $phone_btn_style;
} // if( $output_phone_button ) {
}); // add_action( 'wp_head', function() use ($phone_btn_style, $phone_btn_exclude_option, $phone_btn_exclude_ids_array) {
// ----------------------------------------------
// add the button html to footer
// ----------------------------------------------
add_action( 'wp_footer', function() use ($button_html_code, $phone_btn_exclude_option, $phone_btn_exclude_ids_array) {
$page_id = yydev_phone_btn_find_page_id();
$phone_btn_exclude_option = $phone_btn_exclude_option; // checking if we should exclude or include pages
$exclude_ids = $phone_btn_exclude_ids_array; // pages we should display on or ignore
$output_phone_button = 1;
// incase we exclude pages
if( $phone_btn_exclude_option === 'exclude' ) {
// incase we choose to exclude an id
if( in_array( $page_id, $exclude_ids) ) {
$output_phone_button = 0;
} // if( in_array( $page_id, $exclude_ids) ) {
} // if( $phone_btn_exclude_option === 'exclude' ) {
// incase we exclude pages
if( $phone_btn_exclude_option === 'include' ) {
// incase we choose to include only on some pages
if( !in_array( $page_id, $exclude_ids) ) {
$output_phone_button = 0;
} // if( !in_array( $page_id, $exclude_ids) ) {
} // if( $phone_btn_exclude_option === 'exclude' ) {
// checking if we should output the button
if( $output_phone_button ) {
// echo html button
echo $button_html_code;
} // if( $output_phone_button ) {
}); // add_action( 'wp_footer', function() use ($button_html_code, $phone_btn_exclude_option, $phone_btn_exclude_ids_array) {
} // if( $display_button_checkbox == 1 ) {
} // if( !empty($getting_plugin_data) ) {