{"id":866,"date":"2010-11-08T11:02:12","date_gmt":"2010-11-08T11:02:12","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-php-widget\/"},"modified":"2010-11-10T13:21:28","modified_gmt":"2010-11-10T13:21:28","slug":"wp-php-widget","status":"closed","type":"plugin","link":"https:\/\/fao.wordpress.org\/plugins\/wp-php-widget\/","author":7287216,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.2","stable_tag":"trunk","tested":"3.0.5","requires":"2.8","requires_php":"","requires_plugins":"","header_name":"WP PHP widget","header_author":"wpxue","header_description":"","assets_banners_color":"","last_updated":"2017-11-28 11:20:18","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/www.wpxue.com\/wp-php-widget","header_author_uri":"http:\/\/www.wpxue.com","rating":5,"author_block_rating":0,"active_installs":1000,"downloads":83057,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog","faq"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1776830","resolution":"2","location":"plugin","width":295,"height":585},"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1776830","resolution":"1","location":"plugin","width":270,"height":256}},"screenshots":{"1":"The widgets screen showing a PHP widget in use.","2":"PHP widget ."}},"plugin_section":[],"plugin_tags":[662,162],"plugin_category":[43],"plugin_contributors":[78664,78665],"plugin_business_model":[],"class_list":["post-866","plugin","type-plugin","status-closed","hentry","plugin_tags-php","plugin_tags-widget","plugin_category-customization","plugin_contributors-wpxue","plugin_contributors-ym99","plugin_committers-ym99"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-php-widget.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-php-widget\/trunk\/screenshot-1.png?rev=1776830","caption":"The widgets screen showing a PHP widget in use."},{"src":"https:\/\/ps.w.org\/wp-php-widget\/trunk\/screenshot-2.png?rev=1776830","caption":"PHP widget ."}],"raw_content":"<!--section=description-->\n<p>This plugin adds a new widget called PHP Widget, which will allow you to include PHP code, you can have Text, HTML, Javascript, Flash and\/or PHP code wordpress template tags as content or title in this widget.\nSo, as long as you want, it can do everything, that is greatful.<\/p>\n\n<h3>Help?<\/h3>\n\n<p>when you add the PHP widget ,you will see help.<\/p>\n\n<h3>Usage . example<\/h3>\n\n<p>`\ntitle:\ncode:<\/p>\n\ntest\n\n<p><br \/> <\/p>\n\n<p>title:<strong><a href=\"#\">url test<\/a><\/strong>\ncode:<\/p>\n\ntest\n\n<p><br \/> <\/p>\n\n<p>title:title\ncode:<\/p>\n\ntest\n\n<p><br \/> <\/p>\n\n<p>title:video\ncode:<\/p>\n\n<p>title:New Posts\u6700\u65b0\u6587\u7ae0\ncode:<\/p>\n\n<ul>    <\/ul>\n\n<p>title:Rand Posts\u968f\u5373\u6587\u7ae0\ncode:<\/p>\n\n<ul> \n 'rand', 'showposts' =&gt; 10));\nif (have_posts()) :\nwhile (have_posts()) : the_post();?&gt;\n<li>&lt;a href=&quot;\"&gt;<\/a><\/li>\n\n<\/ul>\n\n<p>title:orderby comments\u8bc4\u8bba\u6392\u884c\ncode:<\/p>\n\n<ul> \n get_results(\"SELECT comment_count,ID,post_title FROM $wpdb-&gt;posts ORDER BY comment_count DESC LIMIT 0 , 10\");\nforeach ($result as $post) {\nsetup_postdata($post);\n$postid = $post-&gt;ID;\n$title = $post-&gt;post_title;\n$commentcount = $post-&gt;comment_count;\nif ($commentcount != 0) { ?&gt;\n<li>&lt;a href=&quot;\" title=\"\"&gt;\n<\/a> ()<\/li>\n\n<\/ul>\n\n<p>title:new comments\u6700\u65b0\u8bc4\u8bba\ncode:<\/p>\n\n<ul> \ncomments \n        LEFT OUTER JOIN $wpdb-&gt;posts ON ($wpdb-&gt;comments.comment_post_ID = $wpdb-&gt;posts.ID) \n        WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' \n        ORDER BY comment_date_gmt DESC \n        LIMIT $src_count\";\n    $comments = $wpdb-&gt;get_results($sql);\n\n    $output = $pre_HTML;\n    $output .= \"\\n<\/ul><ul>\";\n    foreach ($comments as $comment) {\n        $output .= \"\\n\\t<li><a href=\"\">ID) . \"#comment-\" . $comment-&gt;comment_ID  . \"\\\" title=\\\" \" . htmlspecialchars($comment-&gt;post_title) . \"\\\"&gt;\" . $comment-&gt;comment_author . \"<\/a> \u5728 <a>ID).\"\\\"&gt;\".htmlspecialchars($comment-&gt;post_title).\"<\/a> : <br \/>\" . substr(strip_tags($comment-&gt;comment_content),0,$src_length) . \"...<\/li>\";\n    }\n    $output = convert_smilies($output);\n    $output .= \"\\n<\/ul>\";\n    $output .= $post_HTML;\n\n  if (empty($comments)) { return ''; } else {   return $output; }\n\n}\n}\n\n\/\/\u7b80\u5316\u7248\uff1aecho '<li><a>comment_post_ID) . '#comment-' . $comment-&gt;comment_ID.'\"&gt;'.get_the_title($comment-&gt;comment_post_ID) .'<\/a><\/li>'; \u53ea\u8f93\u51fa\u6807\u9898\n\n\/\/\u8f93\u51fa\u8bc4\u8bba\u4eba\u548c\u8bc4\u8bba\u5185\u5bb9\uff1a       $output .= \"\\n\\t<li><a href=\"\">ID) . \"#comment-\" . $comment-&gt;comment_ID  . \"\\\" title=\\\" \" . htmlspecialchars($comment-&gt;post_title) . \"\\\"&gt;\" . $comment-&gt;comment_author.\":\".substr(strip_tags($comment-&gt;comment_content),0,$src_length) . \"  ...<\/a><\/li>\";\n\n?&gt;\n\n\n\n\n<p>title:postviews\u70ed\u95e8\u6587\u7ae0\ncode:<\/p>\n\n<ul> \n\n   \n\n<\/ul>\n\n<p>title:Time\u52a0\u8f7d\u65f6\u95f4\ncode:\n  queries in s.<\/p>\n\n<p>`<\/p>\n\n<p>etc<\/p>\n\n<p>You can have Text, HTML, Javascript, Flash and\/or PHP code as content or title in this widget.<\/p>\n\n<p>So, as long as you want, it can do everything, that is greatful.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the folder wp-php-widget to the `\/wp-content\/plugins\/<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Navigate to Appear &gt; widget &gt; PHP widget \nyou will see PHP widget ,Use the widget like any other widget.<\/li>\n<\/ol>\n\n<p>when you add the PHP widget ,you will see help.<\/p>\n\n<!--section=changelog-->\n<h4>1.0.2<\/h4>\n\n<p>fixed usage,add help link<\/p>\n\n<h4>1.0.1<\/h4>\n\n<p>add usage code<\/p>\n\n<h4>1.0.0<\/h4>\n\n<p>create PHP widget<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><ol>\n<li>Upload the folder wp-php-widget to the `\/wp-content\/plugins\/<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Navigate to Appear &gt; widget &gt; PHP widget \nyou will see PHP widget ,Use the widget like any other widget.<\/li>\n<\/ol>\n\n<p>when you add the PHP widget ,you will see help.<\/p><\/dd>\n\n<\/dl>","raw_excerpt":"This plugin adds a new widget called PHP Widget, which will allow you to include PHP code, you can have Text, HTML, Javascript, Flash and\/or PHP code  &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=866"}],"author":[{"embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/ym99"}],"wp:attachment":[{"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=866"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=866"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=866"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=866"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=866"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/fao.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}