Plugin Directory

Changeset 958257


Ignore:
Timestamp:
07/31/2014 06:25:43 PM (12 years ago)
Author:
hunk
Message:

tag 2.2.2.2

Location:
magic-fields-2/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • magic-fields-2/trunk/admin/mf_post.php

    r906980 r958257  
    1616    //
    1717    add_action( 'admin_footer', array( &$this,'mf_check_wp_gallery_version') );
     18
     19    add_action( 'admin_head', array( &$this,'check_exist_visual_editor') );
     20
    1821  }
    1922
     
    490493  public function check_exist_visual_editor(){
    491494
    492     if( !empty( $_GET['post']) && is_numeric( $_GET['post'] ) ) {//when the post already exists
    493       $post_type = get_post_type($_GET['post']);   
    494     }else{ //Creating a new post
    495       $post_type = (!empty($_GET['post_type'])) ? $_GET['post_type'] : 'post';
    496     }
    497 
    498     $fields = $this->get_unique_custom_fields_by_post_type($post_type);
    499 
    500     /* add tiny_mce script */
    501     /* only add of editor support no exits for the post type*/
    502     if( (in_array('multiline',$fields) || in_array('image_media',$fields) )  && !post_type_supports($post_type,'editor' ) ){
    503       echo "<div style='display:none'>";
    504       echo wp_editor('','you_know_nothing');
    505       echo "</div>";
    506     }
    507 
    508    
    509    
    510   }
     495    if( strstr( $_SERVER['REQUEST_URI'], 'post-new.php' ) !== FALSE  || strstr( $_SERVER['REQUEST_URI'],  'wp-admin/post.php') !== FALSE ) {
     496
     497      if( isset($_GET['action']) && $_GET['action'] == 'trash' ) {//when the post already exists
     498        return;
     499      }   
     500
     501      if( !empty( $_GET['post']) && is_numeric( $_GET['post'] ) ) {//when the post already exists
     502        $post_type = get_post_type($_GET['post']);   
     503      }else{ //Creating a new post
     504        $post_type = (!empty($_GET['post_type'])) ? $_GET['post_type'] : 'post';
     505      }
     506
     507      $mf_posttype = new mf_posttype();
     508      $pt = $mf_posttype->get_post_type($post_type);
     509       
     510      if ($pt && !isset($pt['support']['editor'])) {
     511        echo "<style>#postdivrich {display:none; }</style>";
     512      }
     513   
     514     }
     515   
     516  }
     517
    511518  public function media_buttons_add_mf(){
    512519   
  • magic-fields-2/trunk/main.php

    r912162 r958257  
    44Plugin URI: http://magicfields.org
    55Description: Create custom fields for your post types
    6 Version: 2.2.2.1
     6Version: 2.2.2.2
    77Author:  Hunk and Gnuget
    88Author URI: http://magicfields.org
     
    238238        /* Load JS and CSS for post page */
    239239        $css_js = new mf_post();
    240         $css_js->check_exist_visual_editor();
    241240        $css_js->load_js_css_base();
    242241        $css_js->load_js_css_fields();
  • magic-fields-2/trunk/mf_extra.php

    r906980 r958257  
    7979
    8080}
     81
     82class Debug
     83{
     84  /**
     85   * Writes log info to a file
     86   * @param $msg string the message to write out
     87   * @param $path string the location to write the messages
     88   * @return null
     89   */
     90  static function log($msg,$path = "") {
     91    if(empty($path)){
     92      $path = MF_FILES_DIR;
     93    }
     94
     95    if(!is_string($msg)){
     96      $msg = print_r($msg,true);
     97    }
     98
     99    $fp = fopen($path.'magic_fields.log', 'a+');
     100    $date = gmdate( 'Y-m-d H:i:s' );
     101    fwrite($fp, "$date - $msg\n");
     102    fclose($fp);
     103   }
     104}
  • magic-fields-2/trunk/mf_register.php

    r912162 r958257  
    3636          $option['supports'][] = $k;
    3737        }
     38      }
     39
     40      if (!in_array("editor", $option['supports'])) {
     41        $option['supports'][] = 'editor';
    3842      }
    3943
  • magic-fields-2/trunk/readme.txt

    r912162 r958257  
    55Requires at least: 3.1
    66Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=edgar%40programador%2ecom&lc=GB&item_name=Donation%20Magic%20Fields&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
    7 Stable tag: 2.2.2.1
     7Stable tag: 2.2.2.2
    88Description:  Magic Fields 2 is a feature rich Wordpress CMS plugin
    99
     
    2626
    2727== Changelog ==
     28
     29= 2.2.2.2 =
     30* fix problem with editor, featured image and more
     31* fix problem in delete item of custom post type
    2832
    2933= 2.2.2.1 =
Note: See TracChangeset for help on using the changeset viewer.