Пример #1
0
 /**
  * Classifieds Pages Settings checks
  */
 public function validate_classifieds_pages_settings($options, $group)
 {
     global $wpdb, $wp_rewrite;
     $pageids = awpcp_get_plugin_pages_ids();
     $pages_updated = 0;
     foreach (awpcp_pages() as $key => $data) {
         $id = intval($pageids[$key]);
         if ($id <= 0) {
             continue;
         }
         $page = get_post($id);
         if (is_null($page)) {
             continue;
         }
         if (sanitize_title($page->post_title) != $page->post_name) {
             $post_name = $page->post_name;
         } else {
             $post_name = sanitize_title($options[$key]);
         }
         $page = array('ID' => $id, 'post_title' => add_slashes_recursive($options[$key]), 'post_name' => $post_name);
         wp_update_post($page);
         $pages_updated = $pages_updated + 1;
     }
     if ($pages_updated) {
         do_action('awpcp-pages-updated');
     }
     flush_rewrite_rules();
     return $options;
 }
Пример #2
0
/**
 * @since 3.4
 * @deprecated 3.5.3
 */
function awpcp_get_pages_ids_from_db()
{
    return awpcp_get_plugin_pages_ids();
}