/** * Adds the output to the custom post list columns created by post_list_columns() * * @param string $column column name * @param int $postID * * @uses called by __construct() * * @return void */ function post_list_columns_output($column, $postID) { switch ($column) { case 'web_address': echo get_post_meta($postID, 'web_address', true); break; case 'category': $cats = simple_links()->get_link_categories($postID); if (is_array($cats)) { echo implode(' , ', $cats); } break; } }
<label><?php _e('Remove Line Break Between Image And Link', 'simple-links'); ?> <input type="checkbox" id="line_break" value="1"/> </label> </p> <fieldset> <legend><?php _e('Include Additional Fields', 'simple-links'); ?> </legend> <?php $fields = simple_links()->getAdditionalFields(); if (empty($fields)) { echo '<em>' . __('There have been no additional fields added', 'simple-links') . '</em>'; } else { ?> <ul> <?php foreach ($fields as $field) { printf('<li><label>%1$s<input class="additional" type="checkbox" value="%1$s"></label></li>', $field); } ?> </ul> <?php } ?> </fieldset>
define('SIMPLE_LINKS_ASSETS_URL', SIMPLE_LINKS_URL . 'assets/'); define('SIMPLE_LINKS_IMG_DIR', SIMPLE_LINKS_ASSETS_URL . 'img/'); define('SIMPLE_LINKS_JS_DIR', SIMPLE_LINKS_ASSETS_URL . 'js/'); define('SIMPLE_LINKS_JS_PATH', SIMPLE_LINKS_DIR . 'assets/js/'); define('SIMPLE_LINKS_CSS_DIR', SIMPLE_LINKS_ASSETS_URL . 'css/'); require dirname(__FILE__) . '/template-tags.php'; require dirname(__FILE__) . '/widgets/SL_links_main.php'; function simple_links_autoload($class) { if (file_exists(SIMPLE_LINKS_DIR . 'classes/' . $class . '.php')) { require SIMPLE_LINKS_DIR . 'classes/' . $class . '.php'; } } spl_autoload_register('simple_links_autoload'); /** @var simple_links $simple_links */ $simple_links = simple_links(); if (is_admin()) { /** @var simple_links_admin $simple_links_admin_func */ $simple_links_admin_func = simple_links_admin(); } function simple_links_load() { Simple_Links_Categories::get_instance(); Simple_Links_WP_Links::init(); add_action('init', array('Simple_Link', 'register_sl_post_type')); if (is_admin()) { Simple_Links_Settings::init(); Simple_Links_Sort::init(); Simple_Links_Visual_Shortcodes::init(); } }
/** * Render the [embed][simple-links][/embed] shortcode * into the complete generated list * * @return string */ public function generate_oembed_results($matches) { //because embed strips all shortcodes simple_links()->register_shortcode(); $content = do_shortcode($matches[0]); return $content; }
/** * Additional Fields * * The Additional_fields Meta box * * @uses called by the add_meta_box function */ public function additional_fields() { ?> <h4> <?php _e("These fields will be available on all link's edit screen, widgets, and shortcodes.", 'simple-links'); ?> </h4> <?php if (is_array(simple_links()->getAdditionalFields())) { foreach (simple_links()->getAdditionalFields() as $field) { ?> <p> <?php _e('Field Name', 'simple-links'); ?> : <input type="text" name="link_additional_fields[]" value="<?php echo trim($field); ?> "/> <span class="link_delete_additional"> X </span> </p> <?php } } ?> <p> <?php _e('Field Name', 'simple-links'); ?> : <input type="text" name="link_additional_fields[] value=" "> <span class="link_delete_additional"> X </span> </p> <!-- Placeholder for JQuery --> <span id="link-extra-field" style="display:none"> <p> <?php _e('Field Name', 'simple-links'); ?> : <input type="text" name="link_additional_fields[] value=" "> <span class="link_delete_additional"> X </span> </p> </span> <span id="link-additional-placeholder"></span> <?php submit_button(__('Add Another', 'simple-links'), 'secondary', 'simple-link-additional'); }