Web Design Weekly #347

Headlines The Future of WordPress Now that some time passed since the global rollout of the new Gutenberg block editor, which was met with some controversy, Alex Panagis thinks it’s a great time to reflect on 2018 and see what’s in store for the future of WordPress in 2019. (wp-modula.com) Lessons from 6 software rewrite stories (medium.com) Get ready for your next interview – Practice for free Practice your coding skills on Pramp, a peer-2-peer mock interviews platform. We’ll match you with other awesome engineers. (pramp.com) Articles Why I Write…

Save/update post_meta with Gutenberg from the panel

I’ve created a block, and I need to save as post_meta a value from an action on the panel. Php side: add_action( ‘init’, ‘yasr_gutenberg_show_in_rest_overall_meta’ ); function yasr_gutenberg_show_in_rest_overall_meta() { register_meta( ‘post’, ‘yasr_overall_rating’, array( ‘show_in_rest’ => true, ‘single’ => true, ‘type’ => ‘number’, ) ); } Then in js, I do this: attributes: { //name of the attribute overallRating: { type: ‘number’, source: ‘meta’, meta: ‘yasr_overall_rating’ }, } edit: function( props ) { const { attributes: {overallRating}, setAttributes, isSelected } = props; /*** Action and ajax action to update metadata and where…

Notice: Trying to get property of non-object in

hope someone of you can help me. On my wordpress-page, i get the following messages, when I use the search function and there are no results: Notice: Trying to get property of non-object in /var/www/vhosts/tronicmart.de/httpdocs/wp-content/themes/oceanwp/inc/helpers.php on line 3392 Notice: Trying to get property of non-object in /var/www/vhosts/tronicmart.de/httpdocs/wp-content/themes/oceanwp/inc/helpers.php on line 3400 Notice: Trying to get property of non-object in /var/www/vhosts/tronicmart.de/httpdocs/wp-content/themes/oceanwp/inc/helpers.php on line 3406 if ( ! function_exists( ‘oceanwp_excerpt’ ) ) { function oceanwp_excerpt( $length = 30 ) { global $post; // Check for custom excerpt –>line 3392 if ( has_excerpt( $post->ID…

Logout without confirmation and SAME window on mobile

I using this code to logout. It works except on mobile it opens a new window. How can I logout with confirmation and redirect to to the same window? add_action(‘check_admin_referer’, ‘logout_without_confirm’, 10, 2); function logout_without_confirm($action, $result) { /** * Allow logout without confirmation */ if ($action == « log-out » && !isset($_GET[‘_wpnonce’])) { $redirect_to = isset($_REQUEST[‘redirect_to’]) ? $_REQUEST[‘redirect_to’] : ‘https://www.example.com’; $location = str_replace(‘&’, ‘&’, wp_logout_url($redirect_to)); header(« Location: $location »); die; } } Source: https://wordpress.stackexchange.com/feeds

srcset attribute in Gutenberg gallery blocks

Gallery block are very useful to layout thumbnails. However, when I choose a columns layout (for example, four columns layout), the srcset for this thumbnail remains the same as a large image. In other words, with a four columns layout, the thumbnails srcset come with: sizes= »(max-width: 768px) 100vw, 768px » So, all thumbnails are built with the large images. For example, in this page: https://stage.margenesdelarte.org/productions/relato-de-salida-al-albergue-2018/ Is it possible to get something like this?: sizes= »(max-width: 768px) 100vw, 200px » Further more, is it possible to set srcset up regarding the number of columns…

Hook to use when customer placing order

Currently I am using woocommerce_thankyou action to run a function that creates an order at a third party service. However, sometimes customers don’t return to the Thank You page after visiting our Payment Service Provider, resulting in no order being created at the third party. Would it be better to use the woocommerce_order_status_completed action? Any other hooks I could use? Is there a scheme/rundown available somewhere of all the actions that follow eachother? Any other ideas to solve this problem? Source: https://wordpress.stackexchange.com/feeds

Web Design Weekly #346

Headlines Rendering on the Web As developers, we are often faced with decisions that will affect the entire architecture of our applications. This can be a difficult, since there are a number of different ways to build a website. (developers.google.com) How to choose your field of software engineering (medium.com) Design + Development, Together at Last Designers and developers need an integrated workflow. Bildr Studio combines design tooling with the power of a full development environment. Build the real app as you design it. (bildr.com) Articles The only reason your CSS…

Default WordPress shortcodes not working?

For whatever reason, the WP shortcodes don’t seem to be working. I’m using the theme Verbosa, on the off-chance that matters. When creating a custom page, the shortcodes are just rendering as text rather than actually executing. I’m making sure I’m using the shortcode block on the Gutenberg editor. Any ideas please?? Is it possible that the theme developer was able to block the shortcodes? Source: https://wordpress.stackexchange.com/feeds

Remove generated category and tag class names from woocommerce product & blog listings markup

I noticed in my wordpress/woocommerce setup that every time i add a tag to a product or a blog post. It adds that tag as a class into the listed item (Product/blog) I also noticed it adds a class in the same place for every category i put these post items into. How can i prevent wordpress and woocommerce from addings these tag and category names into my html markup as classes? As i do not need them and its creating a mess. Thanks for any help! I could not…