When i am in SCF Dummy Content setting part :
Notice: Undefined index: upload_image in D:\wamp\www\wordpress381\wp-content\plugins\scf-dummy-content\scf-dummy-options-page.php on line 55
Notice: Undefined index: upload_image in D:\wamp\www\wordpress381\wp-content\plugins\scf-dummy-content\scf-dummy-options-page.php on line 64
Notice: Undefined index: title in D:\wamp\www\wordpress381\wp-content\plugins\scf-dummy-content\scf-dummy-options-page.php on line 87
Notice: Undefined index: title_tax in D:\wamp\www\wordpress381\wp-content\plugins\scf-dummy-content\scf-dummy-options-page.php on line 98
Notice: Use of undefined constant slug - assumed 'slug' in D:\wamp\www\wordpress381\wp-content\plugins\scf-dummy-content\scf-dummy-options-page.php on line 118
Thanks
]]>When I run the plugin, it throws several script errors. I am running the plugin locally, using XAMPP on Mac OSX Mountain Lion.
Warning: Invalid argument supplied for foreach() in /Users/<user>/Documents/Websites/<url>/wp-content/plugins/scf-dummy-content/scf-dummy-class.php on line 123
Warning: Cannot modify header information – headers already sent by (output started at /Users/<user>/Documents/Websites/<url>/wp-content/plugins/scf-dummy-content/scf-dummy-class.php:123) in /Users/zengy/Documents/Websites/yackbox.dev/wp-includes/option.php on line 563
Warning: Cannot modify header information – headers already sent by (output started at /Users/<user>/Documents/Websites/<url>/wp-content/plugins/scf-dummy-content/scf-dummy-class.php:123) in /Users/zengy/Documents/Websites/yackbox.dev/wp-includes/option.php on line 564
https://www.ads-software.com/extend/plugins/scf-dummy-content/
]]>Hello, I’m having some problems in using this plugin.
I installed it on my website ( which is a WordPress 3.4.1 with bbPress 2.1.2 with italian localization ), but when clicking to execute, only posts were created ( altought I had selected some custom post types ) with title ‘0 x’ (where x is the incrementing number ) instead of the post type.
Doing some research in the code to find out what was the problem, I had a look at the scfdc_render_form()
and found the problem: the plugin is using the name
attribute in the Labels
array, which changes upon localizations ( in english is ‘Post’, while in italian is ‘Articoli’ ). This lead to broken post types and post names.
Solving this problem is quite easy: use the slug of the post_type instead of the name.
<?php
$scf_post_types = $scfdc->scf_registered_post_types();
foreach ($scf_post_types as $scf_post_type_slug => $scf_post_type ) {
if ( $scf_post_type_slug == 'attachment' ||
$scf_post_type_slug == 'revision' ||
$scf_post_type_slug == 'nav_menu_item' )
continue;
echo '<label>
<input name="scfdc_options[cpt]['.$scf_post_type_slug.']"
type="checkbox"
value="1" ';
if(isset($options['cpt'][$scf_post_type_slug])){
checked('1',$options['cpt'][$scf_post_type_slug]);
}
echo '/>
'.$scf_post_type->labels->name.'
</label>
';
}
If you’re hosting your code somewhere I’d be glad to contribute to this plugin.
Regards,
Edoardo Tenani
https://www.ads-software.com/extend/plugins/scf-dummy-content/
]]>