Support Forum » User Profile

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: Admin Filter for Custom Taxonomy? #46941
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Ah, thanks. Our theme came with MetaBoxes and some extensions, but not all, so we've bought some like MB Blocks but not Admin Columns. I went to look at the cost of that and the sales page at https://metabox.io/plugins/mb-admin-columns/ mentioned a standalone plugin that does Admin Taxonomy Filter, which is all we need for now, so that plugin solved it.

    I appreciate your support and willingness to recommend a free plugin when that fits the solution!

    in reply to: oEmbed Not Available - Get URL? #46621
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Meant to add my current solution is to get the array with rwmb_get_value and loop it with WP's built in wp_oembed_get, so please update this if there is a better way:

    
    $url = rwmb_get_value( 'view_kids_oembed' );
    printPre($url);
    foreach ($url as $link) {
    	$embed = wp_oembed_get($link);
    	if ($embed) {
    		echo $embed;
    	} else {
    		echo '<a href="">'.$link.'</a><br>';
    	}
    }
    
    in reply to: Show Post ID on Field Type Post? #46361
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Thanks, that worked great!

    in reply to: Displaying MB Blocks Multiple Ways? #46341
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Hi,

    I'm sorry for not following up on this as I believe I found the answer in the default WP docs.

    To clarify, I was hoping to show the Gutenberg block I created differently on different post/page templates. I am able to read the page template using code below, and added an if statement based on the result.

    If you or anyone else has other or better suggestions, I'm definitely open to other ideas, too.

    
    function metabox_render_callback($attributes) {
    	//echo get_the_ID().'='.get_page_template_slug(get_the_ID()); //current postID and template
    	//if statement based on get_page_template_slug result
    }
    

    Thanks for following up, and I believe this is solved 🙂

    in reply to: Custom URL to Show Meta Box Content? #45833
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Thanks, they pointed me to https://awhitepixel.com/custom-url-endpoints-wordpress-rewrite-api/ for this specific request in case anyone else comes here looking in the future.

    in reply to: Adding a Meta Box for a Custom Post Type? #45493
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Well, this was my silly mistake as I put the post_types inside the fields array. I moved it out and it worked perfectly. Feel free to delete this question or mark it as solved with the corrected code below! On to tabs...

    
    add_filter('rwmb_meta_boxes', 'career_data');
    function career_data($meta_boxes) {
    	$meta_boxes[] = [
    		'title' => 'Career Data',
    		'fields' => [
    			[
    				'id'   => 'career_data',
    				'name' => 'Wages',
    				'type' => 'wysiwyg',
    				//'visible' => [ 'post_type', 'career' ],
    			],
    		],
    		'post_types' => ['career'],
    	];
    	return $meta_boxes;
    }
    
    in reply to: Show Image Using Meta Value in Metabox? #44409
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Thanks. I wasn't sure, but was able to create a custom field type using https://docs.metabox.io/creating-new-field-types/ as that met my needs better.

    in reply to: MB Block Not Searching Attachments? #43914
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Thanks. I see it does work when I add query_args and post_status of inherit since Media files use Inherit instead of Publish by default. This seems to get me what I want as it looks like the WP_Query loop knows to only get the most recent Post/Page and not all the inherited revisions.

    
    'fields' => [
    	[
    		'id'   => 'vpp_post',
    		'type' => 'post',
    		'name' => 'Post or Page?',
    		'post_type' => ['post','page','attachment'],
    		'field_type'  => 'select_advanced',
    		'query_args'  => [
    			'post_status'    => ['publish','inherit'],
    			'posts_per_page' => - 1,
    		],
    	],
    ],
    

    I'm not sure if updating the code to work without the query_args is the right answer, or updating the docs, but I'll let you and the devs work that out 🙂

    Thanks again for taking a look!
    Andrew

Viewing 8 posts - 1 through 8 (of 8 total)