From a289638ec355dae93264e89c9b7ca0da668207a9 Mon Sep 17 00:00:00 2001 From: Paul Wong-Gibbs Date: Thu, 13 Jun 2024 11:40:14 +0200 Subject: [PATCH] Add documentation for WordPress.DB.RestrictedFunctions See #1722 --- .../Docs/DB/RestrictedFunctionsStandard.xml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 WordPress/Docs/DB/RestrictedFunctionsStandard.xml diff --git a/WordPress/Docs/DB/RestrictedFunctionsStandard.xml b/WordPress/Docs/DB/RestrictedFunctionsStandard.xml new file mode 100644 index 0000000000..c0c01a1ccc --- /dev/null +++ b/WordPress/Docs/DB/RestrictedFunctionsStandard.xml @@ -0,0 +1,53 @@ + + + + + + + + mysqli_query( + $mysql, + "SELECT * FROM wp_posts LIMIT 5" +); + ]]> + + + get_posts(); + ]]> + + + + + mysqli_query( + $mysql, + "INSERT INTO wp_posts (post_title) + VALUES ('Title')" +); + ]]> + + + wp_insert_post( + array( 'post_title' => 'Title' ) +); + +// or... + +global $wpdb; +$wpdb->insert( + "{$wpdb->prefix}_posts", + array( 'post_title' => 'Title' ), + array( '%s' ) +); + ]]> + + +