How can I check if a var is equal a translated label?

You need to pass the text domain too. Assuming that you have the proper .mo and .po file, and loaded the text domain successfully: if( $_POST[“save”] === __( ‘Publish’, ‘text-domain’ ) ){ //do something } But this is not generally a good idea. You should do your checks based on something more certain, not a … Read more

wp-cli post create & media import issues

So I just ended up doing a query on the database for the link of the image: wp db query “SELECT guid FROM wp_posts WHERE ID=’ID_FROM_MEDIA_IMPORT’” –silent –skip-column-names I wrote this bash script for the whole process: post-create.sh PATH_TO_IMAGE.FILETYPE “TITLE” imageID=$(wp media import $1 –porcelain) imageLINK=$(wp db query “SELECT guid FROM wp_posts WHERE ID=’$imageID'” –silent … Read more

Non-existant URL redirects to existant one

If with “update of the permalinks” you mean updating the post’s slug: WordPress uses a function called wp_old_slug_redirect() to find out if you’re looking for a post whose slug was recently changed and redirect you to its new home.

Can wordpress post and sidebar remain visible after scroll?

Sounds like a fixed position and 100% height are what you’re after: position: fixed; height: 100%; The TwentyFifteen theme uses the following code in style.css: @media screen and (min-width: 59.6875em) { body:before { display: block; height: 100%; min-height: 100%; position: fixed; top: 0; left: 0; width: 29.4118%; } .sidebar { float: left; margin-right: -100%; max-width: … Read more