Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

how to hard code get_option({MY SERIALIZED DATA}) WordPress

  • SOLVED

how would I hard code


$apt_settings = get_option('automatic_post_tagger');



when the option_value = this:


a:32:{s:18:"apt_plugin_version";s:3:"1.5";s:24:"apt_admin_notice_install";i:0;s:23:"apt_admin_notice_update";s:1:"0";s:23:"apt_admin_notice_prompt";i:0;s:18:"apt_hidden_widgets";s:0:"";s:22:"apt_stats_current_tags";s:3:"308";s:22:"apt_stats_install_date";i:1378963764;s:9:"apt_title";s:1:"1";s:11:"apt_content";s:1:"1";s:11:"apt_excerpt";s:1:"0";s:25:"apt_handling_current_tags";s:1:"1";s:21:"apt_convert_diacritic";s:1:"0";s:15:"apt_ignore_case";s:1:"1";s:14:"apt_strip_tags";s:1:"0";s:23:"apt_replace_whitespaces";s:1:"0";s:27:"apt_replace_nonalphanumeric";s:1:"1";s:20:"apt_ignore_wildcards";s:1:"1";s:22:"apt_substring_analysis";s:1:"0";s:29:"apt_substring_analysis_length";s:4:"1000";s:28:"apt_substring_analysis_start";s:1:"0";s:13:"apt_wildcards";s:1:"1";s:31:"apt_wildcards_alphanumeric_only";s:1:"0";s:19:"apt_word_separators";s:31:".,?!:;'"`\/()[]{}_+=-<>~@#$%^&*";s:13:"apt_tag_limit";s:2:"20";s:21:"apt_tagging_hook_type";s:1:"1";s:20:"apt_string_separator";s:1:",";s:22:"apt_wildcard_character";s:1:"*";s:18:"apt_stored_backups";s:1:"5";s:20:"apt_warning_messages";s:1:"1";s:32:"apt_bulk_tagging_posts_per_cycle";s:3:"250";s:22:"apt_bulk_tagging_queue";s:0:"";s:25:"apt_bulk_tagging_statuses";s:30:"auto-draft,draft,inherit,trash";}


I want to hard code this into php so I don't have to do a query for it

Answers (2)

2014-11-06

Dbranes answers:

You can try this:

$apt_settings = array(
'apt_plugin_version' => 1.5,
'apt_admin_notice_install' => 0,
'apt_admin_notice_update' => 0,
'apt_admin_notice_prompt' => 0,
'apt_hidden_widgets' => '',
'apt_stats_current_tags' => 308,
'apt_stats_install_date' => 1378963764,
'apt_title' => 1,
'apt_content' => 1,
'apt_excerpt' => 0,
'apt_handling_current_tags' => 1,
'apt_convert_diacritic' => 0,
'apt_ignore_case' => 1,
'apt_strip_tags' => 0,
'apt_replace_whitespaces' => 0,
'apt_replace_nonalphanumeric' => 1,
'apt_ignore_wildcards' => 1,
'apt_substring_analysis' => 0,
'apt_substring_analysis_length' => 1000,
'apt_substring_analysis_start' => 0,
'apt_wildcards' => 1,
'apt_wildcards_alphanumeric_only' => 0,
'apt_word_separators' => ".,?!:;'\"`\/()[]{}_+=-<>~@#$%^&*",
'apt_tag_limit' => 20,
'apt_tagging_hook_type' => 1,
'apt_string_separator' => ',',
'apt_wildcard_character' => '*',
'apt_stored_backups' => 5,
'apt_warning_messages' => 1,
'apt_bulk_tagging_posts_per_cycle' => 250,
'apt_bulk_tagging_queue' => '',
'apt_bulk_tagging_statuses' => 'auto-draft,draft,inherit,trash',
);


Katie comments:

this is working thx


Dbranes comments:

ok great ;-)

2014-11-06

John Cotton answers:

$a = array (
'apt_plugin_version' => 1.5,
'apt_admin_notice_install' => 0,
'apt_admin_notice_update' => 0,
'apt_admin_notice_prompt' => 0,
'apt_hidden_widgets' => null,
'apt_stats_current_tags' => 308,
'apt_stats_install_date' => 1378963764,
'apt_title' => 1,
'apt_content' => 1,
'apt_excerpt' => 0,
'apt_handling_current_tags' => 1,
'apt_convert_diacritic' => 0,
'apt_ignore_case' => 1,
'apt_strip_tags' => 0,
'apt_replace_whitespaces' => 0,
'apt_replace_nonalphanumeric' => 1,
'apt_ignore_wildcards' => 1,
'apt_substring_analysis' => 0,
'apt_substring_analysis_length' => 1000,
'apt_substring_analysis_start' => 0,
'apt_wildcards' => 1,
'apt_wildcards_alphanumeric_only' => 0,
'apt_word_separators' => '.,?!:;\'"`\/()[]{}_+=-<>~@#$%^&*',
'apt_tag_limit' => 20,
'apt_tagging_hook_type' => 1,
'apt_string_separator' => ',',
'apt_wildcard_character' => '*',
'apt_stored_backups' => 5,
'apt_warning_messages' => 1,
'apt_bulk_tagging_posts_per_cycle' => 250,
'apt_bulk_tagging_queue' => null,
'apt_bulk_tagging_statuses' => 'auto-draft,draft,inherit,trash'
);