Skip to content

mf-register.php keeps tossing errors into debug.log #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions mf_register.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
class mf_register{

public $name = 'mf_register';

function __construct(){
add_action('init', array( &$this, 'mf_register_custom_taxonomies' ) );
add_action('init', array( &$this, 'mf_register_post_types' ) );

}

// register post type
public function mf_register_post_types(){
global $mf_pt_register,$mf_pt_unique;

$post_types = $this->_get_post_types();

foreach($post_types as $p){
$p = unserialize($p['arguments']);

Expand All @@ -43,10 +43,10 @@ public function mf_register_post_types(){
$option['taxonomies'][] = $k;
}
}
if(isset($option['has_archive']) && $option['has_archive'] && isset($option['has_archive_slug']) && $option['has_archive_slug'])
if(isset($option['has_archive']) && $option['has_archive'] && isset($option['has_archive_slug']) && $option['has_archive_slug'])
$option['has_archive'] = $option['has_archive_slug'];


if($option['rewrite'] && $option['rewrite_slug'])
$option['rewrite'] = array( 'slug' => $option['rewrite_slug'],'with_front' => $option['with_front']);

Expand All @@ -65,19 +65,19 @@ public function mf_register_post_types(){
}elseif( !in_array($option['capability_type'],array('post','page')) ){
$option['capabilities'] = $this->_get_cap($option['capability_type']);
}

//description
$option['description'] = $p['core']['description'];
register_post_type($name,$option);

//add unique post type
if ($p['core']['quantity']) {
if ( isset($p['core']['quantity']) && $p['core']['quantity'] ) {
array_push($mf_pt_unique, "edit.php?post_type=".$name);
}


}

}

public function _get_cap($name){
Expand Down Expand Up @@ -122,8 +122,8 @@ public function mf_register_custom_taxonomies(){

}

/**
* return all post types
/**
* return all post types
*/
private function _get_post_types(){
global $wpdb;
Expand All @@ -133,8 +133,8 @@ private function _get_post_types(){
return $posttypes;
}

/**
* return all custom_taxonomy
/**
* return all custom_taxonomy
*/
private function _get_custom_taxonomies(){
global $wpdb;
Expand Down