what is %d used for in arrays on wordpress?

I presume it means double but what does it mean in general?

 $wpdb->delete(
      "data",
      [ 'id' => $id ],
      [ '%d' ]
    );

I get that I’m deleting from table data using array id => id but what is the %d for?

Read More

Why am I asking? well, I’d like to do some bulk updates as shown through the features built in with wp_list_table as shown through this tutorial. As I’ve looked around for that first link I found a few more sources on how to fix my table – I’m just trying do multiple operations and I’m stuck with bulkupdater

Related posts

1 comment

  1. its to identify the type of data to be deleted think where=%d which means interger

    others include:

    %d - interger (just to make it clear)
    %f - float
    %s - string
    

    so your code

    $wpdb->delete(
      "data",
      [ 'id' => $id ],
      [ '%d' ]
    );
    

    Is only going to delete an id where the id string is an integer e.g. 43 not if a43

    You can have obviously a few types in an array, but they need to match the order of the data array (i.e. array('id'=>$id, 'numval'=>$num) ,array(integer, integer) )

Comments are closed.