{"id":325,"date":"2017-02-26T13:29:38","date_gmt":"2017-02-26T13:29:38","guid":{"rendered":"http:\/\/emacslisp.com\/?p=325"},"modified":"2017-06-26T06:02:10","modified_gmt":"2017-06-26T06:02:10","slug":"wordpress-database-scheme","status":"publish","type":"post","link":"http:\/\/emacslisp.com\/?p=325","title":{"rendered":"WordPress &#8211; Database Scheme"},"content":{"rendered":"<p>when installing wordpress,<br \/>\nusing salt<br \/>\nhttps:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/<br \/>\nto get random string text as ID of website.<\/p>\n<p><strong>in scheme.php whose path is (wp-admin\/includes\/schema.php)<br \/>\n<\/strong><br \/>\n$blog_tables has table name, scheme, and all information wp need.<\/p>\n<p>Step By Step.<br \/>\n1. After clicking on &#8216;Installing wordpress&#8217;, dbDelta(&#8216;all&#8217;) will call wp_get_db_schema(&#8216;all&#8217;) in schema.php to get all sql script.<\/p>\n<pre lang=\"php\" line=\"1\">\r\nfunction dbDelta( $queries = '', $execute = true ) {\r\n..\tif ( in_array( $queries, array( '', 'all', 'blog', 'global', 'ms_global' ), true ) )\r\n\t    $queries = wp_get_db_schema( $queries );\r\n..\r\n}\r\n\r\nfunction wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '' ) {\r\n...\r\n\tmake_db_current_silent(); \/\/ here we go to dbDelta\r\n...\r\n}\r\n <\/pre>\n<p>in scheme.php:<br \/>\nfunction populate_options()<\/p>\n<p>wordpress will load default theme which defined in WP_DEFAULT_THEME.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>when installing wordpress, using salt https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/ to get random string text as ID of website. in scheme.php whose path is (wp-admin\/includes\/schema.php) $blog_tables has table name, scheme, and all information wp need. Step By Step. 1. After clicking on &#8216;Installing wordpress&#8217;, dbDelta(&#8216;all&#8217;) will call wp_get_db_schema(&#8216;all&#8217;) in schema.php to get all sql script. function dbDelta( $queries = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-325","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=325"}],"version-history":[{"count":4,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/325\/revisions"}],"predecessor-version":[{"id":362,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/325\/revisions\/362"}],"wp:attachment":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}