link = $link; // Set meta-box context name $this->context = $page; if ($this->for_feed_settings()) : $this->context .= 'forfeed'; endif; } /* FeedWordPressAdminPage constructor */ function for_feed_settings () { return (is_object($this->link) and method_exists($this->link, 'found') and $this->link->found()); } function for_default_settings () { return !$this->for_feed_settings(); } /*static*/ function submitted_link_id () { global $fwp_post; // Presume global unless we get a specific link ID $link_id = NULL; $submit_buttons = array( 'save', 'submit', 'fix_mismatch', 'feedfinder', ); foreach ($submit_buttons as $field) : if (isset($fwp_post[$field])) : $link_id = $_REQUEST['save_link_id']; endif; endforeach; if (is_null($link_id) and isset($_REQUEST['link_id'])) : $link_id = $_REQUEST['link_id']; endif; return $link_id; } /* FeedWordPressAdminPage::submitted_link_id() */ /*static*/ function submitted_link () { $link_id = FeedWordPressAdminPage::submitted_link_id(); if (is_numeric($link_id) and $link_id) : $link =& new SyndicatedLink($link_id); else : $link = NULL; endif; return $link; } /* FeedWordPressAdminPage::submitted_link () */ function stamp_link_id ($field = null) { if (is_null($field)) : $field = 'save_link_id'; endif; ?> for_feed_settings()) : $phrase = __('posts from this feed'); else : $phrase = __('syndicated posts'); endif; return $phrase; } /* FeedWordPressAdminPage::these_posts_phrase() */ /** * Provides a uniquely identifying name for the interface context for * use with add_meta_box() and do_meta_boxes(), * * @return string the context name * * @see add_meta_box() * @see do_meta_boxes() */ function meta_box_context () { return $this->context; } /* FeedWordPressAdminPage::meta_box_context () */ /** * Outputs JavaScript to fix AJAX toggles settings. * * @uses FeedWordPressAdminPage::meta_box_context() */ function fix_toggles () { FeedWordPressSettingsUI::fix_toggles_js($this->meta_box_context()); } /* FeedWordPressAdminPage::fix_toggles() */ function ajax_interface_js () { ?>
; ?>)
These settings only affect posts syndicated from link->link->link_name, 1); ?>.
These settings affect posts syndicated from any feed unless they are overridden by settings for that specific feed.
ajax_interface_js(); if (function_exists('add_meta_box')) : add_action( FeedWordPressCompatibility::bottom_script_hook($this->filename), /*callback=*/ array($this, 'fix_toggles'), /*priority=*/ 10000 ); FeedWordPressSettingsUI::ajax_nonce_fields(); endif; ?>
" />
0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
Use the settings page to set up how new posts will be published, whether they will accept comments and pings, any custom fields that should be set on each post, etc.
Use the settings page to set up how new posts will be assigned to authors.
Use the settings page to set up how new posts are assigned categories or tags.
\n\n"; wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); echo "
\n\n"; endif; } /* FeedWordPressSettingsUI::ajax_nonce_fields () */ /*static*/ function fix_toggles_js ($context) { ?> 0) : $userdata = array(); $userdata['ID'] = NULL; $userdata['user_login'] = sanitize_user($newuser_name); $userdata['user_login'] = apply_filters('pre_user_login', $userdata['user_login']); $userdata['user_nicename'] = sanitize_title($newuser_name); $userdata['user_nicename'] = apply_filters('pre_user_nicename', $userdata['user_nicename']); $userdata['display_name'] = $wpdb->escape($newuser_name); $newuser_id = wp_insert_user($userdata); if (is_numeric($newuser_id)) : $ret = $newuser_id; else : // TODO: Add some error detection and reporting endif; else : // TODO: Add some error reporting endif; return $ret; } /* fwp_insert_new_user () */ function fwp_add_meta_box ($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args = null) { if (function_exists('add_meta_box')) : return add_meta_box($id, $title, $callback, $page, $context, $priority, $callback_args); else : /* Re-used as per terms of the GPL from add_meta_box() in WordPress 2.8.1 wp-admin/includes/template.php. */ global $wp_meta_boxes; if ( !isset($wp_meta_boxes) ) $wp_meta_boxes = array(); if ( !isset($wp_meta_boxes[$page]) ) $wp_meta_boxes[$page] = array(); if ( !isset($wp_meta_boxes[$page][$context]) ) $wp_meta_boxes[$page][$context] = array(); foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) { foreach ( array('high', 'core', 'default', 'low') as $a_priority ) { if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) ) continue; // If a core box was previously added or removed by a plugin, don't add. if ( 'core' == $priority ) { // If core box previously deleted, don't add if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] ) return; // If box was added with default priority, give it core priority to maintain sort order if ( 'default' == $a_priority ) { $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id]; unset($wp_meta_boxes[$page][$a_context]['default'][$id]); } return; } // If no priority given and id already present, use existing priority if ( empty($priority) ) { $priority = $a_priority; // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority. } elseif ( 'sorted' == $priority ) { $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title']; $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback']; $callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args']; } // An id can be in only one priority and one context if ( $priority != $a_priority || $context != $a_context ) unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]); } } if ( empty($priority) ) $priority = 'low'; if ( !isset($wp_meta_boxes[$page][$context][$priority]) ) $wp_meta_boxes[$page][$context][$priority] = array(); $wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $callback_args); endif; } /* function fwp_add_meta_box () */ function fwp_do_meta_boxes($page, $context, $object) { if (function_exists('do_meta_boxes')) : $ret = do_meta_boxes($page, $context, $object); // Avoid JavaScript error from WordPress 2.5 bug ?> \n"; $i = 0; do { if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) break; foreach ( array('high', 'sorted', 'core', 'default', 'low') as $priority ) { if ( isset($wp_meta_boxes[$page][$context][$priority]) ) { foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { if ( false == $box || ! $box['title'] ) continue; $i++; fwp_option_box_opener($box['title'], $box['id'], 'postbox' /*. postbox_classes($box['id'], $page)*/); call_user_func($box['callback'], $object, $box); fwp_option_box_closer(); if (is_object($object) and method_exists($object, 'interstitial')) : $object->interstitial(); else : // Submit button for WP 1.5, early 2.x style fwp_settings_form_periodic_submit(); endif; } } } } while(0); echo ""; return $i; endif; } /* function fwp_do_meta_boxes() */ function fwp_remove_meta_box($id, $page, $context) { if (function_exists('remove_meta_box')) : return remove_meta_box($id, $page, $context); else : /* Re-used as per terms of the GPL from remove_meta_box() in WordPress 2.8.1 wp-admin/includes/template.php */ global $wp_meta_boxes; if ( !isset($wp_meta_boxes) ) $wp_meta_boxes = array(); if ( !isset($wp_meta_boxes[$page]) ) $wp_meta_boxes[$page] = array(); if ( !isset($wp_meta_boxes[$page][$context]) ) $wp_meta_boxes[$page][$context] = array(); foreach ( array('high', 'core', 'default', 'low') as $priority ) $wp_meta_boxes[$page][$context][$priority][$id] = false; endif; } /* function fwp_remove_meta_box() */