Ejemplo n.º 1
0
 private function valid_per_post($post)
 {
     if (!class_exists('WPDD_Utils') || !method_exists('WPDD_Utils', 'page_has_layout') || !is_object($post)) {
         return false;
     }
     if (self::$layout_id = WPDD_Utils::page_has_layout($post->ID)) {
         self::$layout_id = WPDD_Utils::get_layout_id_from_post_name(self::$layout_id);
         return true;
     }
     return false;
 }
 public static function page_has_layout($post_id)
 {
     return WPDD_Utils::page_has_layout($post_id);
 }
 public function assign_layout_to_newly_created_post($post_id, $post_type)
 {
     $layout_slug = WPDD_Utils::page_has_layout($post_id);
     if ($layout_slug) {
         return $this->update_single_post_layout($layout_slug, $post_id, $post_type['post_type']);
     }
     $layout_data = $this->get_layout_to_type_object($post_type['post_type']);
     if ($layout_data === null) {
         return null;
     }
     $layout_id = (int) $layout_data->layout_id;
     $ret = $this->update_post_meta_for_post_type(array($post_id), $layout_id);
     return $ret;
 }