clownay
Forum Replies Created
-
Roch, how can i import all my players from JSON endpoint into your custom post type? I’ve tried anything possible now or is it even possible to post to the import function you have in your plugin?
I am actually using the ID, nfl_team_slug returns the ID of the team.
Is there anyway I can use your CSV importer in my own plugin, to import the players? The problem is that I’m getting all the players from a JSON endpoint in my own plugin and create the players trough that.
Roch, you got any idea what is going on?
This is the post data being sent when i create one on via wp-admin
_wpnonce:f9a2db03c2
_wp_http_referer:/wp-admin/post-new.php?post_type=sp_player
user_ID:3
action:editpost
originalaction:editpost
post_author:3
post_type:sp_player
original_post_status:auto-draft
referredby:http://nflgeeks.com/wp-admin/admin.php?page=gulklud
_wp_original_http_referer:http://nflgeeks.com/wp-admin/admin.php?page=gulklud
auto_draft:
post_ID:10235
meta-box-order-nonce:67011d791a
closedpostboxesnonce:d8dca0bca2
post_title:Andreas Quist
samplepermalinknonce:06103d97ee
content:
wp-preview:
hidden_post_status:draft
post_status:draft
hidden_post_password:
hidden_post_visibility:public
visibility:public
post_password:
mm:08
jj:02
aa:2016
hh:07
mn:31
ss:05
hidden_mm:08
cur_mm:08
hidden_jj:02
cur_jj:02
hidden_aa:2016
cur_aa:2016
hidden_hh:07
cur_hh:07
hidden_mn:31
cur_mn:31
original_publish:Udgiv
publish:Udgiv
menu_order:0
_um_custom_access_settings:0
_um_accessible:0
_um_access_redirect2:
_um_access_roles[]:0
_um_access_redirect:
um_admin_save_metabox_access_nonce:a276ef939f
_wp_http_referer:/wp-admin/post-new.php?post_type=sp_player
sp_twitter:
sp_columns[]:0
sp_columns[]:0
sportspress_meta_nonce:39166d70b2
_wp_http_referer:/wp-admin/post-new.php?post_type=sp_player
sp_number:
sp_nationality[]:den
tax_input[sp_position][]:0
sp_current_team[]:2645
tax_input[sp_league][]:0
tax_input[sp_league][]:16
tax_input[sp_season][]:0
sp_metrics[height]:
sp_metrics[weight]:
excerpt:
post_name:
post_author_override:3
slide_template:default
twitter_custom:4a1ec65607
_wp_http_referer:/wp-admin/post-new.php?post_type=sp_player
twitter_share[text]:
twitter_share[hashtags]:
twitter_card[title]:
twitter_card[description]:Just to clarify, this is what i do when i add a player via my own plugin
public function myplugin_add_player($post_data, $player, $team_slug) { $post_id = wp_insert_post($post_data); $player_name_slug = strtolower($player->first_name . '-' . $player->last_name); $player_team_slug_short = substr($team_slug, 4); # Set Position wp_set_object_terms($post_id, $player->position_name, 'sp_position', false); # Set League wp_set_object_terms($post_id, 'NFL', 'sp_league', false); # Set Nationality update_post_meta($post_id, 'sp_nationality', trim(strtolower($player->country))); # Set Team And Current Team update_post_meta($post_id, 'sp_current_team', $this->nfl_team_slug[$team_slug]); # Set Player Image $this->gulklud_get_player_image($player_team_slug_short, $player_name_slug, $player->name, $post_id); }