How to ignore fields if empty?

I found one solutions and it works, just in case someone could have the same question, I know that the response could be with an: if(input==””){ } But the problem was that I’m inserting every model in an object, so if the fields are empty, it insert in the object empty values, so I just … Read more

Bash script to check available updates

WP-CLI and AWK One way is to do the counting of the available string in the third column via AWK: wp plugin list | \ awk ‘BEGIN{N=0;} \ ($3==”available”){N++; print $0;} \ END{print(N>0)?”Plugin updates available: “N:”No plugin updates available”;}’ where N is the number of available updates, in case you need the number, $0 is … Read more

How get horizontal div instead vertical CSS

<style> .makeitseo{ width: 100%; margin: 10px auto; text-align: center; display: flex; justify-content: center; } img { width: 100%; } .cell { margin: 10px 10px 10px 10px; height: 400px; width: 400px; padding: 2px; display: flex; align-items: center; overflow: auto; flex-direction: column; } </style> use this styles for your html and change the parent container with so … Read more

Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?

1.) First, when creating a shortcode, you must return data, not print. 2.) Yes, you must explicitly specify the post id, print the id in the button or form of your shortcode, you can also use the shortcode attributes to generate a button for a specific post (See example) Your shortcode code should be like … Read more