Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter kdoole

    (@kdoole)

    This appears to work quite nicely.

    Thread Starter kdoole

    (@kdoole)

    Yep, understand that, but I have an array with about 40 elements (very rough guess) that tests against the user agent string. So instead of having to maintain a list of every conceivable user mobile agent string (there are many) to a user agent group, i’d like to be able to use a preg_match_all and just test for some key words in the string.

    My guess would be:

    w3tc_add_action('w3tc_pgcache_cache_key', 'modify_page_key');
    function modify_page_key($key) {
        //if user agent matches any of the elements in the array of mobile-like user agent words, $key .= 'something_special';
    }

    I will give this a try now, but if you have a better solution, lay it on me! I think this should work though… right?

    This works for me (inside functions.php):

    add_action( 'do_meta_boxes', 'move_image_box' );
    function move_image_box() {
    	remove_meta_box( 'postimagediv', '[your_post_type]', 'side' );
    	add_meta_box( 'postimagediv', __( 'Featured image' ), 'post_thumbnail_meta_box', '[your_post_type]', 'normal', 'high' );
    }

    See docs for add_meta_box for details on how to control where you place the meta box.

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