{"id":120,"date":"2021-10-17T10:12:17","date_gmt":"2021-10-17T02:12:17","guid":{"rendered":"https:\/\/ltyxh.com\/?p=120"},"modified":"2021-10-28T22:42:32","modified_gmt":"2021-10-29T02:42:32","slug":"wp-plugins-lyric","status":"publish","type":"post","link":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/","title":{"rendered":"[Simple tutorial for WordPress plugin development]Display random lyric at the homepage"},"content":{"rendered":"\n<p>Plugins are a very important way for WordPress to customize your blog site. One of the most familiar plugins to WordPress users is probably Hello Dolly &#8211; which comes with the WordPress installation and is used as a tutorial to teach users how to use and develop plugins. Once enabled it will display Hello Dolly lyrics randomly in the top right corner of the backend page.<\/p>\n\n\n\n<p>The plugin itself has no practical use, but I enabled it for the purpose of having fun. After a while the idea arose to change the lyrics to what I wanted, such as my own playlist, <span class='argon-hidden-text argon-hidden-text-background'>Vocaloid China<\/span> and display them in the homepage instead of admin interface.<\/p>\n\n\n\n<h2>Hello, Dolly<\/h2>\n\n\n\n<p>I downloaded Hello Dolly for such purpose. <em>Hello Dolly<\/em> contains a PHP file with the following code (part of the code has been omitted).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/**\n * @package Hello_Dolly\n * @version 1.7.2\n *\/\n\/*\n&lt;?php\n\/**\n * @package Hello_Dolly\n * @version 1.7.2\n *\/\n\/*\nPlugin Name: Hello Dolly\nPlugin URI: http:\/\/wordpress.org\/plugins\/hello-dolly\/\nDescription: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from &lt;cite>Hello, Dolly&lt;\/cite> in the upper right of your admin screen on every page.\nAuthor: Matt Mullenweg\nVersion: 1.7.2\nAuthor URI: http:\/\/ma.tt\/\n*\/\n\nfunction hello_dolly_get_lyric() {\n\t\/** Lyrics. Omitted. *\/\n\t$lyrics = \"Hello, Dolly\n\";\n\n\t\/\/ Here we split it into lines.\n\t$lyrics = explode( \"\\n\", $lyrics );\n\n\t\/\/ And then randomly choose a line.\n\treturn wptexturize( $lyrics&#091; mt_rand( 0, count( $lyrics ) - 1 ) ] );\n}\n\n\/\/ This just echoes the chosen line, we'll position it later.\nfunction hello_dolly() {\n\t$chosen = hello_dolly_get_lyric();\n\t$lang   = '';\n\tif ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {\n\t\t$lang = ' lang=\"en\"';\n\t}\n\n\tprintf(\n\t\t'&lt;p id=\"dolly\">&lt;span class=\"screen-reader-text\">%s &lt;\/span>&lt;span dir=\"ltr\"%s>%s&lt;\/span>&lt;\/p>',\n\t\t__( 'Quote from Hello Dolly song, by Jerry Herman:', 'hello-dolly' ),\n\t\t$lang,\n\t\t$chosen\n\t);\n}\n\n\n\/\/ Now we set that function up to execute when the admin_notices action is called.\nadd_action( 'admin_notices', 'hello_dolly' );\n\n\/\/ We need some CSS to position the paragraph.\nfunction dolly_css() {\n\techo \"\n        &lt;!-- CSS format. Omitted.-->\n\t&lt;style type='text\/css'>\n\t#dolly \n\t&lt;\/style>\n\t\";\n}\n\nadd_action( 'admin_head', 'dolly_css' );\n<\/code><\/pre>\n\n\n\n<p>The plugin is mainly divided into two parts: the comment that introduces the basic information and the code behind it. WordPress reads the header comment to get the basic information of the plugin, such as the plugin name, author, introduction, etc., which only needs to be filled in accordingly.<\/p>\n\n\n\n<p>The part of the code where you can see the random lyric interception is still very simple and straightforward. The function <code>hello_dolly_get_lyric() <\/code>selects a random line of lyrics; <code>hello_dolly()<\/code> prints out the lyrics returned by <code>hello_dolly_get_lyric()<\/code> with the original composition information. <code>dolly_css()<\/code> is responsible for placing the necessary css to manage the way the lyrics are displayed. Finally the plugin is mounted using wp&#8217;s hook (add_action), which is triggered to execute when the admin interface is loaded.<\/p>\n\n\n\n<p>Hooks hooks are the key to plugins being able to add functionality without changing the kernel. plugins in Wp are mainly divided into two types: action and filter. the action type inserts a piece of code into the specified time point for execution. For example, after the page is loaded, a greeting window pops up before the body is loaded; the filter outputs the input data after certain processing, such as having all the body content appended with a paragraph about the author before it is displayed. Here we take action type as an example, we write the callback function first, and then mount our callback function by add_action().<\/p>\n\n\n\n<p>In the WordPress development documentation, the add_action method is described as follows.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_action( string $hook_name, callable $callback, int $priority = 10, int $accepted_args = 1 )<\/code><\/pre>\n\n\n\n<p>The function has four basic parameters: the name of the hook used, the callback function, the callback priority and the number of parameters accepted. The hook name is a mandatory parameter and determines where the function is inserted. Examples are <code>save_post<\/code> (after the post has been saved), <code>admin_head<\/code> (backend page header), etc. The second parameter is the callback function we want to pass in. The last two parameters are optional and are the priority and the number of parameters. The priority determines the order of execution, the smaller the number the higher the priority, the default is 10.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u5c06\u63d2\u4ef6\u8bbe\u7f6e\u4e3a\u7ba1\u7406\u754c\u9762\u65f6\u6267\u884c\nadd_action( 'admin_notices', 'hello_dolly' );<\/code><\/pre>\n\n\n\n<h2>With customized themes<\/h2>\n\n\n\n<p>After figuring out the basics of how plugins work in wp, we can get started. The personalized theme (using the argon used on this page) provides several places on the home page where lyrics can be placed, such as the subtitle, the motto bar and the announcement bar. Here is the example of the motto bar. You can view the theme code by going to the Appearance-Theme Editor page in the WP backend administration interface. In <em>theme Argon<\/em>, the motto bar is located in the sidebar of the page, as shown in the figure.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/ltyxh.com\/en\/wp-content\/uploads\/sites\/3\/2021\/10\/\u56fe\u7247-1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" width=\"1212\" height=\"910\" data-original=\"https:\/\/ltyxh.com\/en\/wp-content\/uploads\/sites\/3\/2021\/10\/\u56fe\u7247-1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-131\"  sizes=\"(max-width: 1212px) 100vw, 1212px\" \/><\/div><figcaption>\u266a \u603b\u662f\u60f3\u592a\u591a\u8fd8\u4e0d\u5982\u4ec0\u4e48\u90fd\u522b\u60f3 \u266a<\/figcaption><\/figure><\/div>\n\n\n\n<p>In the sidebar <code>sidebar.php<\/code> of the theme file, include the following code to control the display of the subheadings\/grams on the left.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php \n\t$sidebar_subtitle = get_option('argon_sidebar_banner_subtitle'); \n\tif ($sidebar_subtitle == \"--hitokoto--\"){\n\t\t$sidebar_subtitle = \"&lt;span class='hitokoto'&gt;&lt;\/span&gt;\";\n\t}\n?&gt;\n&lt;?php if ($sidebar_subtitle != '') { \/*\u5de6\u4fa7\u680f\u5b50\u6807\u9898\/\u683c\u8a00(\u5982\u679c\u9009\u9879\u4e2d\u5f00\u542f)*\/?&gt;\n\t&lt;span class=\"leftbar-banner-subtitle text-white\"&gt;&lt;?php echo $sidebar_subtitle; ?&gt;&lt;\/span&gt;\n&lt;?php } \/*\u9876\u680f\u6807\u9898*\/?&gt;\n<\/code><\/pre>\n\n\n\n<p>The theme will get our pre-set motto from the WordPress data table using the <code>get_option()<\/code> method. The custom theme does not provide hooks for us to modify the content of the banner field here, so if we don&#8217;t modify the theme file we have to do it to the wp data table. the Option data table is a separate data table in the WordPress database that stores custom data for the site and is open for users and plugins to modify and edit. So a possible idea is to change the value of argon_aidebar_banner_subtitle in the data table to what we want after each refresh, before the page is displayed.<\/p>\n\n\n\n<p>WordPress provides the following functions to manipulate the option data table in a single site\uff08Cited from <a rel=\"noreferrer noopener\" href=\"https:\/\/www.wpzhiku.com\/understanding-working-wordpress-options-table\/\" target=\"_blank\">wpzhiku.com\/understanding-working-wordpress-options-table<\/a>\uff09\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u51fd\u6570<\/th><th>\u53c2\u6570<\/th><th>\u5907\u6ce8<\/th><\/tr><\/thead><tbody><tr><td><code>add_option()<\/code><\/td><td><code>$option<\/code>,<br><code>$value<\/code>,<br><code>$deprecated<\/code>,<br><code>$autoload<\/code><\/td><td>only  <code>$option<\/code>\u00a0 is required.<\/td><\/tr><tr><td><code>delete_option()<\/code><\/td><td><code>$option<\/code><\/td><td>Delete all records of this item.<\/td><\/tr><tr><td><code>get_option()<\/code><\/td><td><code>$option<\/code>,<br><code>$default<\/code><\/td><td><code>$default<\/code> (Optional) Return this value if the option is not available.<\/td><\/tr><tr><td><code>update_option()<\/code><\/td><td><code>$option<\/code>,<br><code>$new_value<\/code><\/td><td><code>$new_value<\/code>\u00a0is the new value of <code>option_value<\/code>\u00a0<\/td><\/tr><tr><td><code>add_site_option()<\/code><\/td><td><code>$option<\/code><br><code>$value<\/code><\/td><td>Similar to<code> add_option()<\/code>\u00a0\uff0cbut in all sites.<\/td><\/tr><tr><td><code>delete_site_option()<\/code><\/td><td><code>$option<\/code><\/td><td>Similar to <code>delete_option()<\/code>,  but in all sites. <\/td><\/tr><tr><td><code>get_site_option()<\/code><\/td><td><code>$option<\/code><br><code>$default<br><\/code><code>$use_cache<\/code><\/td><td><code>\u548c\u00a0get_option()<\/code>\u00a0, but used in multisite mode.<\/td><\/tr><tr><td><code>update_site_option()<\/code><\/td><td><code>$option<\/code>,&nbsp;<code>$value<\/code><\/td><td><code>\u548c\u00a0update_option()<\/code>\u00a0, but used in multisite mode.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The code implementation of the plug-in is as follows.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/**\n * @package VC_lyrics_random_display\n * @version 2012.7.12\n *\/\n\/*\nPlugin Name: Singsingsing-\u4e3b\u9875\u968f\u673a\u663e\u793avc\u6b4c\u8bcd\nPlugin URI: https:\/\/ltyxh.com\nDescription: \u535a\u5ba2\u4e3b\u9875\u6bcf\u6b21\u5237\u65b0\u663e\u793a\u4e00\u53e5\u968f\u673aVC\u6b4c\u8bcd\u3002\u9002\u7528\u4e8e\u6240\u6709\u4e3b\u9898\uff0c\u81ea\u884c\u4fee\u6539\u63d2\u4ef6\u5373\u53ef\u3002\u3010\u9ed8\u8ba4\u4e3aargon\u4e3b\u9898\/\u663e\u793a\u4f4d\u7f6e\u535a\u5ba2\u683c\u8a00\u533a\u3011\u4e16\u754c\u5f88\u5927\u5f88\u4e71\uff0c\u5730\u7403\u5728\u8f6c\uff0c\u6570\u4e0d\u6e05\u7684\u5404\u79cd\u60b2\u548c\u6b22\u3002\u603b\u662f\u60f3\u592a\u591a\u8fd8\u4e0d\u5982\u4ec0\u4e48\u90fd\u522b\u60f3\u3002\nAuthor: \u73de\u6797\nVersion: 2012.7.12\nAuthor URI: https:\/\/ltyxh.com\/\n*\/\n\nfunction vc_get_lyric() {\n    define('MYPLUGINNAME_PATH', plugin_dir_path(__FILE__) );\n\t$lyrics = file_get_contents(MYPLUGINNAME_PATH . 'vc_lyrics.txt');\n\t$lyrics = explode( \"\\n\", $lyrics );\n\treturn wptexturize( $lyrics&#091; mt_rand( 0, count( $lyrics ) - 1 ) ] );\n}\n\n\nfunction vc_lyric_change_option() {\n\t$chosen = vc_get_lyric();\n\t$chosen = str_replace(array(' ','&amp;nbsp;'),'',$chosen);\n\t\/\/\u4fee\u6539\u6570\u636e\u8868\n\tupdate_option( 'argon_sidebar_banner_subtitle', $chosen);\n}\n\n\/\/execute when the plugins_loaded action is called.\nadd_action( 'plugins_loaded', 'vc_lyric_change_option' );<\/code><\/pre>\n\n\n\n<p>With the large amount of alternative lyrics, it is obviously not wise to cram them into the variable initialization statements of the code, nor is it convenient to modify them later. So here we put the lyrics in a separate file vc_lryics.txt. We have mounted the function to &#8220;plugins_loaded&#8221;, which means that it is executed when the page loads the plugin. Note that when reading vc_lyrics.txt, we need to get and add the wp plugin path in front of the file name, otherwise the file will not be found and an error will be reported.<\/p>\n\n\n\n<p>As for the demonstration, readers can go back to the Chinese home page of the blog to experience it. In Argon mobile to view the sidebar need to click the top left corner. Have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Plugins are a very important way for WordPress to customize your blog site. One of the most familiar plugins to WordPress users is probably Hello Dolly &#8211; which comes with the WordPress installation and is used as a tutorial to teach users how to use and develop plugins. Once enabled it will display Hello Dolly [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":138,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[22],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Simple tutorial for Wordpress plugin development]Display random lyric at the homepage - Luolin&#039;s blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Simple tutorial for Wordpress plugin development]Display random lyric at the homepage - Luolin&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"Plugins are a very important way for WordPress to customize your blog site. One of the most familiar plugins to WordPress users is probably Hello Dolly &#8211; which comes with the WordPress installation and is used as a tutorial to teach users how to use and develop plugins. Once enabled it will display Hello Dolly [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/\" \/>\n<meta property=\"og:site_name\" content=\"Luolin&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-17T02:12:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-29T02:42:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ltyxh.com\/en\/wp-content\/uploads\/sites\/3\/2021\/10\/0066mSqdly1geas51zgg4j31d61ogx6p-e1634531962394.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1767\" \/>\n\t<meta property=\"og:image:height\" content=\"1213\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u73de\u6797\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ltyxh.com\/en\/#website\",\"url\":\"https:\/\/ltyxh.com\/en\/\",\"name\":\"Luolin&#039;s blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ltyxh.com\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/ltyxh.com\/en\/wp-content\/uploads\/sites\/3\/2021\/10\/0066mSqdly1geas51zgg4j31d61ogx6p-e1634531962394.jpg\",\"contentUrl\":\"https:\/\/ltyxh.com\/en\/wp-content\/uploads\/sites\/3\/2021\/10\/0066mSqdly1geas51zgg4j31d61ogx6p-e1634531962394.jpg\",\"width\":1767,\"height\":1213},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#webpage\",\"url\":\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/\",\"name\":\"[Simple tutorial for Wordpress plugin development]Display random lyric at the homepage - Luolin&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\/\/ltyxh.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#primaryimage\"},\"datePublished\":\"2021-10-17T02:12:17+00:00\",\"dateModified\":\"2021-10-29T02:42:32+00:00\",\"author\":{\"@id\":\"https:\/\/ltyxh.com\/en\/#\/schema\/person\/c29f7f1f1b922bf671a91c9e7649a662\"},\"breadcrumb\":{\"@id\":\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ltyxh.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Simple tutorial for WordPress plugin development]Display random lyric at the homepage\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ltyxh.com\/en\/#\/schema\/person\/c29f7f1f1b922bf671a91c9e7649a662\",\"name\":\"\\u73de\\u6797\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ltyxh.com\/en\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a7e81f7dd6e980c0f4b0515f34dc80f8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a7e81f7dd6e980c0f4b0515f34dc80f8?s=96&d=mm&r=g\",\"caption\":\"\\u73de\\u6797\"},\"sameAs\":[\"http:\/\/ltyxh.com\"],\"url\":\"https:\/\/ltyxh.com\/en\/author\/wele\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Simple tutorial for Wordpress plugin development]Display random lyric at the homepage - Luolin&#039;s blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/","og_locale":"en_US","og_type":"article","og_title":"[Simple tutorial for Wordpress plugin development]Display random lyric at the homepage - Luolin&#039;s blog","og_description":"Plugins are a very important way for WordPress to customize your blog site. One of the most familiar plugins to WordPress users is probably Hello Dolly &#8211; which comes with the WordPress installation and is used as a tutorial to teach users how to use and develop plugins. Once enabled it will display Hello Dolly [&hellip;]","og_url":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/","og_site_name":"Luolin&#039;s blog","article_published_time":"2021-10-17T02:12:17+00:00","article_modified_time":"2021-10-29T02:42:32+00:00","og_image":[{"width":1767,"height":1213,"url":"https:\/\/ltyxh.com\/en\/wp-content\/uploads\/sites\/3\/2021\/10\/0066mSqdly1geas51zgg4j31d61ogx6p-e1634531962394.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u73de\u6797","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/ltyxh.com\/en\/#website","url":"https:\/\/ltyxh.com\/en\/","name":"Luolin&#039;s blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ltyxh.com\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#primaryimage","inLanguage":"en-US","url":"https:\/\/ltyxh.com\/en\/wp-content\/uploads\/sites\/3\/2021\/10\/0066mSqdly1geas51zgg4j31d61ogx6p-e1634531962394.jpg","contentUrl":"https:\/\/ltyxh.com\/en\/wp-content\/uploads\/sites\/3\/2021\/10\/0066mSqdly1geas51zgg4j31d61ogx6p-e1634531962394.jpg","width":1767,"height":1213},{"@type":"WebPage","@id":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#webpage","url":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/","name":"[Simple tutorial for Wordpress plugin development]Display random lyric at the homepage - Luolin&#039;s blog","isPartOf":{"@id":"https:\/\/ltyxh.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#primaryimage"},"datePublished":"2021-10-17T02:12:17+00:00","dateModified":"2021-10-29T02:42:32+00:00","author":{"@id":"https:\/\/ltyxh.com\/en\/#\/schema\/person\/c29f7f1f1b922bf671a91c9e7649a662"},"breadcrumb":{"@id":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ltyxh.com\/en\/2021\/10\/17\/wp-plugins-lyric\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ltyxh.com\/en\/"},{"@type":"ListItem","position":2,"name":"[Simple tutorial for WordPress plugin development]Display random lyric at the homepage"}]},{"@type":"Person","@id":"https:\/\/ltyxh.com\/en\/#\/schema\/person\/c29f7f1f1b922bf671a91c9e7649a662","name":"\u73de\u6797","image":{"@type":"ImageObject","@id":"https:\/\/ltyxh.com\/en\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/a7e81f7dd6e980c0f4b0515f34dc80f8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a7e81f7dd6e980c0f4b0515f34dc80f8?s=96&d=mm&r=g","caption":"\u73de\u6797"},"sameAs":["http:\/\/ltyxh.com"],"url":"https:\/\/ltyxh.com\/en\/author\/wele\/"}]}},"_links":{"self":[{"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/posts\/120"}],"collection":[{"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":2,"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":312,"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/posts\/120\/revisions\/312"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/media\/138"}],"wp:attachment":[{"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ltyxh.com\/en\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}