Adding HTML Code to Replace Text in PHP

One way to handle this with the approach you’ve taken is to expand on the PHP code for the check to see if the user is logged in like so: <?php if (!is_user_logged_in()) : ?> <style> .product-purchase-box{display: none;} .linktologin{display: inline;} </style> <?php else : ?> <style> .product-purchase-box{display: inline;} .linktologin{display: none;} </style> <?php endif; ?> Then, … Read more

remove edit link only for published post and pending post

Try this, where I changed the function to accept the second parameter which is the current post in the list table: add_filter( ‘post_row_actions’, ‘remove_row_actions’, 10, 2 ); function remove_row_actions( $actions, $post ) { if ( $post && ‘post’ === $post->post_type && in_array( $post->post_status, array( ‘publish’, ‘pending’ ) ) ) { unset( $actions[‘edit’] ); } return … Read more