/** * Perform image search * * @param array $params * @return array */ function cfcp_about_image_search($params) { $imgs = new WP_Query(array('s' => trim(stripslashes($params['term'])), 'posts_per_page' => 12, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'post__not_in' => !empty($params['exclude']) ? (array) $params['exclude'] : array(), 'order' => 'ASC', 'fields' => 'ids')); $ret = ''; if (!empty($imgs->posts)) { $post_type_object = get_post_type_object('attachment'); $img_size = 'tiny-img'; foreach ($imgs->posts as $img_id) { $ret .= '<li class="cfp-search-result">' . cfct_template_content('functions/about/views', 'image-item', compact('img_id', 'post_type_object', 'img_size')) . '</li>'; } } if (!empty($ret)) { $ret = '<ul>' . $ret . '</ul>'; } return $ret; }
function cfcp_get_popover_html($popover_id, $params = array()) { $html = $class = ''; if (!empty($params['html'])) { $html = $params['html']; } if (!empty($params['class'])) { $class = esc_attr($params['class']); } $arrow_pos = 'center'; if (!empty($params['arrow_pos'])) { $arrow_pos = esc_attr($params['arrow_pos']); } $display = 'none'; if (!empty($params['display'])) { $display = esc_attr($params['display']); } return cfct_template_content('misc', 'admin-popover-template', compact('popover_id', 'html', 'arrow_pos', 'class', 'display')); }
/** * Chooses the appropriate template file for the excerpt in a feed and returns that content * **/ function cfct_excerpt_feed($content) { if (is_feed()) { // find template $file = cfct_choose_content_template_feed('excerpt'); if ($file) { // load template $content = cfct_template_content('excerpt', $file); } } return $content; }
if (!empty($settings['links']) && is_array($settings['links'])) { foreach ($settings['links'] as $link) { if (is_array($link)) { cfct_template_file('functions/about/views', 'link-item', compact('link')); } } } ?> </ul> </div><!--.cfp-link--> <a href="#cfp-link-edit-popover" class="cfp-add-link" id="cfp-add-link"><?php _e('Add', 'favepersonal'); ?> </a> </div> </fieldset> <p class="submit"><input class="button button-primary" type="submit" name="submit" value="<?php _e('Save Settings', 'favepersonal'); ?> " /></p> </form> </div><!--#cfp-about--> </div><!-- / cf-about-wrap --> <?php // images popover echo cfcp_get_popover_html('cfp-img-search-popover', array('html' => cfct_template_content('functions/about/views', 'img-search-popover'), 'arrow_pos' => 'right')); // links popover echo cfcp_get_popover_html('cfp-link-edit-popover', array('html' => cfct_template_content('functions/about/views', 'link-edit-popover'), 'arrow_pos' => 'right')); echo cfcp_get_popover_html('cfp-link-remove-popover', array('html' => cfct_template_content('functions/about/views', 'link-remove-popover'), 'arrow_pos' => 'left'));
echo esc_attr($settings['title']); ?> "> </div> <div class="cf-elm-block cf-elm-width-full"> <label for="bio" class="typ-sc"><?php _e('Bio', 'favepersonal'); ?> </label> <textarea rows="6" cols="40" class="cf-elm-textarea" name="<?php echo CFCP_ABOUT_SETTINGS; ?> [description]" id="cfcp_settings_description"><?php echo esc_textarea($settings['description']); ?> </textarea> </div> </fieldset> <p class="submit"><input class="button button-primary" type="submit" name="submit" value="<?php _e('Save Settings', 'favepersonal'); ?> " /></p> </form> </div><!--#cfp-about--> </div><!-- / cf-about-wrap --> <?php // images popover echo cfcp_get_popover_html('cfp-img-search-popover', array('html' => cfct_template_content('functions/about/views', 'img-search-popover'), 'arrow_pos' => 'right'));