{"id":8069,"date":"2023-08-14T14:19:55","date_gmt":"2023-08-14T21:19:55","guid":{"rendered":"https:\/\/membermouse.com\/?post_type=ht_kb&#038;p=8069"},"modified":"2025-10-20T10:20:50","modified_gmt":"2025-10-20T14:20:50","slug":"uber-die-php-schnittstelle","status":"publish","type":"ht_kb","link":"https:\/\/membermouse.com\/de\/docs\/uber-die-php-schnittstelle\/","title":{"rendered":"Verwendung der PHP-Schnittstelle"},"content":{"rendered":"<p>MemberMouse bietet Ihnen eine breite Palette von&nbsp;<a href=\"https:\/\/membermouse.com\/de\/docs\/smarttags-ubersicht\/\">SmartTags\u2122.<\/a>&nbsp;you can use to create a dynamic experience for your members. There are SmartTags\u2122 that display the current member's name, email address, and other information. There are tags you can use to allow members to manage their subscriptions, others to change content based on the current member's access rights, and a lot more!<\/p>\n\n\n\n<p>Das ist alles sehr hilfreich, wenn Sie mit dem WordPress-Inhaltseditor arbeiten, aber was ist, wenn Sie all dies in einem benutzerdefinierten PHP-Skript tun m\u00f6chten?<\/p>\n\n\n\n<p>An dieser Stelle kommt die PHP-Schnittstelle ins Spiel.<\/p>\n\n\n\n<p><strong>ANMERKUNG<\/strong>: MemberMouse currently requires a minimum of PHP 7.4. We recommend the latest version of the PHP branch. Please see our\u00a0<a href=\"https:\/\/membermouse.com\/de\/docs\/membermouse-system-und-hosting-anforderungen\/\" target=\"_blank\" rel=\"noreferrer noopener\">System- und Hosting-Anforderungen<\/a>\u00a0um die aktuellsten Informationen zu erhalten.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">Anforderungen an die PHP-Schnittstelle<\/h5>\n\n\n\n<p>Die PHP-Schnittstellenfunktionen ben\u00f6tigen Zugriff auf die MemberMouse-Bibliotheken, um zu funktionieren. Wenn Sie die PHP-Schnittstellenfunktionen innerhalb einer WordPress-Vorlage verwenden, werden diese Bibliotheken automatisch geladen. Wenn Sie sie jedoch in einem eigenst\u00e4ndigen PHP-Skript verwenden m\u00f6chten, m\u00fcssen Sie die MemberMouse-Bibliotheken manuell laden, indem Sie die folgenden Includes am Anfang Ihrer Datei hinzuf\u00fcgen: <\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>require_once(\"wp-load.php\");\nrequire_once(\"wp-content\/plugins\/membermouse\/includes\/mm-constants.php\");\nrequire_once(\"wp-content\/plugins\/membermouse\/includes\/init.php\");<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Wenn sich Ihr Skript im WordPress-Stammverzeichnis befindet, k\u00f6nnen Sie die Includes genau so verwenden, wie sie oben dargestellt sind. Wenn sich Ihr Skript in einem anderen Verzeichnis befindet, m\u00fcssen Sie die Dateipfade entsprechend aktualisieren.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">Translating SmartTags\u2122 in PHP Functions<\/h5>\n\n\n\n<p>With MemberMouse's PHP Interface you can utilize MemberMouse SmartTags\u2122 right within a custom PHP script. You can use any WordPress plugin for executing PHP (i.e. PHP Exec) to use the PHP Interface functions right within the WordPress content editor. All SmartTags\u2122 are supported through the PHP Interface with the exception of&nbsp;MM_Form&#8230;&nbsp;and&nbsp;MM_Error&#8230;&nbsp;SmartTags\u2122.<\/p>\n\n\n\n<p>When using SmartTags\u2122 within the WordPress content editor the following syntax is used: <\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>[MM_Mitglied_Daten name='email']\n[MM_Member_Decision membershipId='2|3']...[\/MM_Member_Decision]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>SmartTags\u2122 are transformed into their PHP interface equivalent by taking the SmartTag\u2122 name, making it all lowercase, and adding parenthesis to make it a valid PHP function. <\/p>\n\n\n\n<p>So for example,&nbsp;[ MM_Order_Data ] becomes mm_order_data ( ).&nbsp;<\/p>\n\n\n\n<p>Sie \u00fcbergeben Attribute an PHP-Schnittstellenfunktionen als assoziatives Array. <\/p>\n\n\n\n<p>Hier sind einige Beispiele: <\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>mm_member_data(array(\"name\"=&gt;\"email\"))\nmm_member_decision(array(\"isMember\"=&gt;\"true\", \"membershipId\"=&gt;\"2|3\"))<\/code><\/pre>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The PHP Interface function accepts all of the same attributes as the SmartTag\u2122 itself. Refer to the&nbsp;<a href=\"https:\/\/membermouse.com\/de\/docs\/smarttags-ubersicht\/\">SmartTag\u2122 documentation<\/a>&nbsp;for a list of attributes by SmartTag\u2122.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">R\u00fcckgabewerte<\/h5>\n\n\n\n<p><code>mm_..._data()<\/code>&nbsp;Funktionen geben eine Zeichenkette zur\u00fcck, die die angeforderten Daten enth\u00e4lt.<\/p>\n\n\n\n<p><code>mm_..._link()<\/code>&nbsp;Funktionen geben einen String zur\u00fcck, der eine URL oder eine Javascript-Funktion enth\u00e4lt, die innerhalb einer&nbsp;<code>&lt;a&gt;<\/code>&nbsp;Tag oder&nbsp;<code><button><\/code>&nbsp;Tag, um ihn zu einem funktionalen Link zu machen.<\/p>\n\n\n\n<p><code>mm_..._Entscheidung()<\/code>&nbsp;Funktionsr\u00fcckgabe&nbsp;<code>wahr<\/code>&nbsp;oder&nbsp;<code>falsch<\/code>&nbsp;auf der Grundlage der an die Funktion \u00fcbergebenen Attribute und des Kontexts, in dem sie ausgef\u00fchrt wird.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">Beispiele<\/h5>\n\n\n\n<p>To see examples of how each SmartTag\u2122 can be used in PHP,&nbsp;<a href=\"https:\/\/drive.google.com\/file\/d\/1n2Cee8PP5Hgu4S3RpRhMoor7mAEOr4tj\/view?usp=drive_link\">das Beispielskript herunterladen<\/a>.<\/p>\n\n\n\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>","protected":false},"excerpt":{"rendered":"<p>MemberMouse provides you with a wide range of&nbsp;SmartTags\u2122&nbsp;you can use to create a dynamic experience for your members. There are SmartTags\u2122 that display the current member&#8217;s name, email address, and&#8230;<\/p>","protected":false},"author":21411,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_strive_editorial_status":"not-started","_strive_copy_of":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"ht-kb-category":[187],"ht-kb-tag":[],"class_list":["post-8069","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-mm-php"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/ht-kb\/8069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/users\/21411"}],"replies":[{"embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/comments?post=8069"}],"version-history":[{"count":1,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/ht-kb\/8069\/revisions"}],"predecessor-version":[{"id":21354,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/ht-kb\/8069\/revisions\/21354"}],"wp:attachment":[{"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/media?parent=8069"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8069"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/membermouse.com\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}