Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • I had to do modify my “/wp-content/cache/.htaccess” file after I installed. I also had to remove
    ob_start("ob_gzhandler");
    From the top of the header file for my theme. I had added it there before I knew about the WP Super Cache. It is PHP’s way of Gzip compressing content. I have the htaccess modifications you can try listed on my site here:
    http://www.aaronwpearson.com/wp-super-cache-ie7-cannot-display-webpage/

    I had to remove the php invocation of gzip from the header.php file of my theme. I had put ob_start("ob_gzhandler"); Other wise IE7 wouldn’t display the webpage.

    I was trying to do something similar in WP 2.8.X, but without any luck. To point you in the right direction look at the functions “_list_meta_row” and “meta_form” in “/wp-admin/includes/template.php” around line 2280. I think the problem is that WP saves the keys and their values ‘on demand’. So if you have an key called “more_info” on one post, but you haven’t added it to 2nd post WP won’t have “more_info” as a key associated with the 2nd post. Meaning there is no place in the database to save info to or reference it by. You can see what I mean if you look at the ‘wp_postmeta’ database table for your site. I was able to create the table with all the keys expanded even if they where empty, but I couldn’t figure out how to save the values.

    I forgot to mention you will also need to modify around line 2366 to prevent the meta key from showing in the drop down menu. Look around 2366 for something like this:

    foreach ( $keys as $key ) {
    $key = attribute_escape( $key );
    echo "\n<option value='$key'>$key</option>"
    }

    Add this code to prevent it from showing in the drop down list under “Add New Custom Field”.

    global $userdata;
    get_currentuserinfo();
    $level = $userdata->user_level; //gets user level

    foreach ( $keys as $key ) {
    $key = attribute_escape( $key );
    if($key == 'customfield_discount' && $level < 10)
    {//do nothing}
    else
    {echo "\n<option value='$key'>$key</option>";}
    }

    In WP 2.8.X you should be able to make these changes in “wp-admin/includes/template.php”. Take a look at the function “_list_meta_row” around line 2282. On line 2293 you should see something like this:

    if ('_' == $entry['meta_key'] { 0 })
    $style .= ' hidden';

    This is saying if there is an underscore character at the beginning of the meta key then hide it. Example would be “_customfield_price”. This is done because WP already has several custom fields it doesn’t want you to see and it designates them by putting an underscore at the beginning of their name. Depending on how detailed you want to get, modify line 2293-2294 to look something like this:

    global $userdata;
    get_currentuserinfo();
    $level = $userdata->user_level; //gets user level

    if ('_' == $entry['meta_key'] { 0 } || $level < 10 && 'customfield_discount' == $entry['meta_key'] )
    $style .= ' hidden';

    This will hide a meta field name “customfield_discount” if the user is not the admin.

Viewing 5 replies - 1 through 5 (of 5 total)