From 58c530269b51c75ff28c4ce26627f640da30a665 Mon Sep 17 00:00:00 2001 From: Paul Wong-Gibbs Date: Thu, 13 Jun 2024 12:17:00 +0200 Subject: [PATCH] Add documentation for WordPress.DB.RestrictedClasses See #1722 --- .../Docs/DB/RestrictedClassesStandard.xml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 WordPress/Docs/DB/RestrictedClassesStandard.xml diff --git a/WordPress/Docs/DB/RestrictedClassesStandard.xml b/WordPress/Docs/DB/RestrictedClassesStandard.xml new file mode 100644 index 0000000000..e004514702 --- /dev/null +++ b/WordPress/Docs/DB/RestrictedClassesStandard.xml @@ -0,0 +1,67 @@ + + + + + + + + $mysqli->query( + $mysqli, + "SELECT * FROM wp_posts LIMIT 5" +); + ]]> + + + get_posts(); + ]]> + + + + + prepare( + "INSERT INTO wp_posts (post_title) + VALUES (?)" +); + +$stmnt->execute( ['Title'] ); + ]]> + + + wp_insert_post( + array( 'post_title' => 'Title' ) +); + +// or... + +global $wpdb; +$wpdb->insert( + "{$wpdb->prefix}_posts", + array( 'post_title' => 'Title' ), + array( '%s' ) +); + ]]> + + + \ No newline at end of file