function st_show_buttons($content) { global $post; $postType = $post->post_type; $getTopOptions = get_option('st_' . $postType . 's_on_top'); $getBotOptions = get_option('st_' . $postType . 's_on_bot'); $selectedPage = get_option('st_page'); if (empty($selectedPage)) { $selectedPage = array(); } if ($post->post_type == 'page' && !in_array($post->ID, $selectedPage) || $post->post_type == 'post') { if ($getTopOptions == 'top' && $getBotOptions == 'bot') { return '<p class="no-break">' . st_makeEntries() . '</p>' . $content . '<p>' . st_makeEntries() . '</p>'; } else { if ($getTopOptions == 'top' && empty($getBotOptions)) { return '<p class="no-break">' . st_makeEntries() . '</p>' . $content; } else { if (empty($getTopOptions) && $getBotOptions == 'bot') { return $content . '<p class="no-break">' . st_makeEntries() . '</p>'; } } } } return $content; }
function st_show_buttons($content) { global $post; $postType = $post->post_type; if (!is_singular(array('post', 'page')) && get_option('st_post_excerpt') == 'false') { return $content; // do not proceed - user has checked the option to hide buttons on excerpts } $getTopOptions = get_option('st_' . $postType . 's_on_top'); $getBotOptions = get_option('st_' . $postType . 's_on_bot'); $selectedPage = get_option('st_page'); if (empty($selectedPage)) { $selectedPage = array(); } if ($post->post_type == 'page' && !in_array($post->ID, $selectedPage) || $post->post_type == 'post') { if ($getTopOptions == 'top' && $getBotOptions == 'bot') { return '<p class="no-break">' . st_makeEntries() . '</p>' . $content . '<p>' . st_makeEntries() . '</p>'; } else { if ($getTopOptions == 'top' && empty($getBotOptions)) { return '<p class="no-break">' . st_makeEntries() . '</p>' . $content; } else { if (empty($getTopOptions) && $getBotOptions == 'bot') { return $content . '<p class="no-break">' . st_makeEntries() . '</p>'; } } } } return $content; }
function st_add_widget($content) { if (is_page() && get_option('st_add_to_page') != 'no' || !is_page() && get_option('st_add_to_content') != 'no') { if (!is_feed()) { return $content . '<p>' . st_makeEntries() . '</p>'; } } return $content; }