{"id":661,"date":"2020-01-12T14:18:30","date_gmt":"2020-01-12T13:18:30","guid":{"rendered":"https:\/\/ekiwi.de\/?p=661"},"modified":"2020-01-12T14:18:30","modified_gmt":"2020-01-12T13:18:30","slug":"php-in-wordpress-ausfuehren-ezphp","status":"publish","type":"post","link":"https:\/\/ekiwi.de\/index.php\/661\/php-in-wordpress-ausfuehren-ezphp\/","title":{"rendered":"PHP in WordPress ausf\u00fchren &#8211; ezPHP"},"content":{"rendered":"<p>WordPress bietet f\u00fcr alles ein Plugin, aber manchmal w\u00fcrden schon ein paar Zeilen PHP-Code gen\u00fcgen, z.B. um eine Datenbanktabelle auszugeben, das aktuelle Datum anzuzeigen und so weiter. Mit dem Plugin ezPHP ist dies m\u00f6glich.<\/p>\n<p><!--more--><\/p>\n<p>Sobald das Plugin aktiv ist, kann PHP-Code in Widgets, Posts und Seiten eingef\u00fcgt werden:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/01\/php_wordpress.png\" alt=\"\" width=\"387\" height=\"325\" class=\"aligncenter size-full wp-image-662\" srcset=\"\/wp-content\/uploads\/2020\/01\/php_wordpress.png 387w, \/wp-content\/uploads\/2020\/01\/php_wordpress-300x252.png 300w\" sizes=\"auto, (max-width: 387px) 100vw, 387px\" \/><\/p>\n<p>Der Code wird beim Aufruf der Seite ausgef\u00fchrt, wie bei einer normalen PHP-Seite.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/01\/php_wordpress_1.png\" alt=\"\" width=\"789\" height=\"609\" class=\"aligncenter size-full wp-image-663\" srcset=\"\/wp-content\/uploads\/2020\/01\/php_wordpress_1.png 789w, \/wp-content\/uploads\/2020\/01\/php_wordpress_1-300x232.png 300w, \/wp-content\/uploads\/2020\/01\/php_wordpress_1-768x593.png 768w\" sizes=\"auto, (max-width: 789px) 100vw, 789px\" \/><\/p>\n<p>Wer nicht m\u00f6chte, dass z.B. in Posts PHP-Code m\u00f6glich ist, kann dies \u00fcber Konfigurationsdirektiven einschr\u00e4nken:<\/p>\n<pre>\r\ndefine('EZPHP_INCLUDED_POST_TYPES', 'page');\r\n<\/pre>\n<p>Wird dies der WordPress-Konfigurationsdatei hinzugef\u00fcgt, wird PHP nur noch auf Seiten eingef\u00fcgt. Damit l\u00e4sst sich z.B. verhindern, dass in Blogs mit vielen Autoren irgendwer Schindluder damit treibt.<\/p>\n<p><a href=\"https:\/\/de.wordpress.org\/plugins\/ezphp\/\" target=\"_blank\" rel=\"noopener noreferrer\">Das Plugin gibt es im Plugin-Verzeichnis von WordPress<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>WordPress bietet f\u00fcr alles ein Plugin, aber manchmal w\u00fcrden schon ein paar Zeilen PHP-Code gen\u00fcgen, z.B. um eine Datenbanktabelle auszugeben,<\/p>\n","protected":false},"author":1,"featured_media":278,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[51],"tags":[31,52],"class_list":["post-661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-php","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/comments?post=661"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/661\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media\/278"}],"wp:attachment":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media?parent=661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/categories?post=661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/tags?post=661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}