WordPress Default Posts to Blogs

add_filter(‘register_post_type_args’, function ($args, $post_type) { if($post_type === ‘post’) { $args[‘labels’][‘name’] = __(‘Blogs’); $args[‘labels’][‘name_admin_bar’] = __(‘Blogs’); $args[‘labels’][‘singular_name’] = __(‘Blogs’); $args[‘labels’][‘new_item’] = __(‘Add Blogs’); $args[‘labels’][‘edit_item’] = __(‘Edit Blogs’); $args[‘labels’][‘delete_item’] = __(‘Remove Blogs’); $args[‘labels’][‘view_item’] = __(‘View Blogs’); $args[‘labels’][‘all_items’] = __(‘All Blogs’); $args[‘labels’][‘search_items’] =…Continue reading

update a database entry 888

//888 from tls- //3040 from Gilroes if ( ! post_password_required() ) { // Code to fetch and print CFs, such as: $key_1_value_1 = get_post_meta( $post->ID, ‘key_1’, true ); echo $key_1_value_1; } $indextls = $_POST[‘indextls’]; echo ‘The index you searched for…Continue reading

Change “Howdy Admin” in Admin Bar

function wpcode_snippet_replace_howdy( $wp_admin_bar ) { // Edit the line below to set what you want the admin bar to display intead of “Howdy,”. $new_howdy = ‘Welcome,’; $my_account = $wp_admin_bar->get_node( ‘my-account’ ); $wp_admin_bar->add_node( array( ‘id’ => ‘my-account’, ‘title’ => str_replace( ‘Howdy,’,…Continue reading

Team Member only allow Team Member Block

add_filter(‘allowed_block_types_all’, ‘enable_blocks_for_custom_post_type’, 10, 2); function enable_blocks_for_custom_post_type($allowed_block_types, $block_editor_context) { if ($block_editor_context->post->post_type === ‘team-member’) { return array(‘acf/team-member’, ‘core/post-featured-image’); } return $allowed_block_types;}Continue reading