{"id":446,"date":"2017-10-31T11:48:13","date_gmt":"2017-10-31T08:48:13","guid":{"rendered":"https:\/\/wpreviewspro.com\/?p=446"},"modified":"2017-10-31T11:48:13","modified_gmt":"2017-10-31T08:48:13","slug":"wordpress-4-9-finally-brings-shortcodes-embedded-media-core-text-widget","status":"publish","type":"post","link":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/?p=446","title":{"rendered":"WordPress 4.9 Finally Brings Shortcodes and Embedded Media to the Core Text Widget"},"content":{"rendered":"\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-top\"\n    data-payload='{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;446&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;top&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;WordPress 4.9 Finally Brings Shortcodes and Embedded Media to the Core Text Widget&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n<p><a href=\"https:\/\/wpneon.com\/best-wordpress-security-plugins\/\">WordPress<\/a> 4.9 is just around the corner, and it comes with <a href=\"https:\/\/make.wordpress.org\/core\/2017\/10\/24\/widget-improvements-in-wordpress-4-9\/\" target=\"_blank\" rel=\"noopener noreferrer\">fantastic widget improvements<\/a>. Finally, users will be able to add <a href=\"https:\/\/wpneon.com\/top-7-wordpress-button-plugins\/\">shortcodes<\/a> to the core Text widget without using <a href=\"https:\/\/wpneon.com\/schema-markup-plugins-wordpress\/\">plugins<\/a> or added code from <a href=\"https:\/\/wpneon.com\/review-category\/themes\/\">themes<\/a>. This was revealed last week by <a href=\"https:\/\/profiles.wordpress.org\/westonruter\" target=\"_blank\" rel=\"noopener noreferrer\">Weston Ruter<\/a>, who&#8217;s part of the WordPress core development team.<\/p>\n<p><strong>Also read:<\/strong>\u00a0<a href=\"https:\/\/wpneon.com\/how-to-disable-gutenberg\/\">How to Disable Gutenberg and Keep the WordPress Classic Editor<\/a><\/p>\n<p>This new feature is in response to a <a href=\"https:\/\/core.trac.wordpress.org\/ticket\/10457\" target=\"_blank\" rel=\"noopener noreferrer\">longstanding request<\/a> &#8211; over 8 years &#8211; to support shortcodes in the Text widget. In the <a href=\"https:\/\/make.wordpress.org\/core\/2017\/10\/24\/widget-improvements-in-wordpress-4-9\/\" target=\"_blank\" rel=\"noopener noreferrer\">dev note<\/a> for the feature, Ruter breaks down the technical details and explains why it took this long to implement the feature.<\/p>\n<h2 style=\"text-align: center;\">WordPress 4.9<\/h2>\n<p><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\">One reason for the long delay with adding shortcode support in Text widgets was due to many shortcodes looking for a global $post when they run. Since the global $post varies depending on whatever the query is, the shortcodes in a Text widget could render wildly different on different templates of a site. <\/span><\/p>\n<p><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\">The solution worked out was to temporarily nullify the global $post before doing the shortcodes so that they will consistently have the same global state, with this global $post then restored after the shortcodes are done. So if you have shortcodes that depend on a global $post\u2014or call get_post()\u2014then you should make sure that they short-circuit when $post is null in order for them to behave properly if used in the Text widget.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-451 size-medium\" src=\"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/wp-content\/uploads\/2017\/10\/text-widget-with-gallery-254x300-1-186x220-1.jpg\" alt=\"WordPress\" width=\"186\" height=\"220\" \/>Besides shortcodes, WordPress 4.9 will also allow users to embed media in the Text widget. There&#8217;s now a new &#8220;Add Media&#8221; button in the Text widget, making it easy for you to add <a href=\"https:\/\/wpneon.com\/best-wordpress-thumbnail-regeneration-plugins\/\">images<\/a>, galleries, videos, audio, and other media.<\/p>\n<p>WordPress 4.9 also allows you to display oEmbeds in the Text widget, while the Video widget has been expanded to support any oEmbed provider for video.<\/p>\n<p>WordPress 4.9 is due for release on November 14, 2017.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div id=\"themify_builder_content-446\" data-postid=\"446\" class=\"themify_builder_content themify_builder_content-446 themify_builder\">\n    <\/div>\n<!-- \/themify_builder_content -->\n","protected":false},"excerpt":{"rendered":"<p>WordPress 4.9 is just around the corner, and it comes with fantastic widget improvements. Finally, users will be able to add shortcodes to the core Text widget without using plugins or added code from themes. This was revealed last week by Weston Ruter, who&#8217;s part of the WordPress core development team. Also read:\u00a0How to Disable [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":454,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[439,665,732,922,923,1002,1156],"class_list":["post-446","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-news","tag-embedded-media-in-text-widget","tag-media-embeds","tag-oembed","tag-shortcodes","tag-shortcodes-in-text-widget","tag-text-widget","tag-wordpress-4-9","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""," cat-47"],"builder_content":"","_links":{"self":[{"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=\/wp\/v2\/posts\/446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=446"}],"version-history":[{"count":0,"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=\/wp\/v2\/posts\/446\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=\/wp\/v2\/media\/454"}],"wp:attachment":[{"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/humble-yellow-mule.74-50-76-122.cpanel.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}