Databasemodel (WordPress)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

Dit is het hoofdartikel rondom het databasemodel van WordPress. Dit it artikel is slechts een beginnetje. Zie sectie [[#Zie verder

URL van een posting

De URL van een posting (vanaf de root van de site) vind je in wp_posts in de kolom post_name [1].

WooCommerce-producten

WooCommerce-productinformatie, vind je voornamelijk op twee plekken [2]:

  • wp_posts
  • wp_postmeta

Voorbeeld: Selecteer de belangrijkste gegevens uit wp_posts en de SKU's uit wp_postmeta:

select 
    wp_posts.ID			as post_id,
    wp_posts.post_title		as post_title,
    wp_posts.post_name		as slug,
    wp_posts.guid		as guid,
    wp_postmeta.meta_value	as sku
from 
    wp_posts
join
    wp_postmeta
    on
    wp_posts.ID = wp_postmeta.post_id
where 
    post_type="product"
    and
    post_status="publish"
    and
    meta_key="_sku";

GUID's

WordPress maintains GUID-fields, like in wp_posts. I think it's okay to update them [3]

Screen Options

[4]:

WordPress Screen Options are displayed in a hanging tab in the upper right of the WordPress dashboard. Screen Options are user specific based on your login name. They're stored in table wp_usermeta

Zie ook

Bronnen