fireproofsocks
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Content Type Manager] Output filtersIt’s in the FAQ, all comes down to “how do I convert a post ID into the data represented by that post?”
https://code.google.com/p/wordpress-custom-content-type-manager/wiki/to_link_OutputFilter
E.g.
<strong><?php print_custom_field('department:to_link'); ?></strong>Or for heavy artillery:
https://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_post_OutputFilter
Forum: Plugins
In reply to: [Custom Content Type Manager] Mass import of data to custom fieldsI’m unfamiliar with WP All Import or WP Importer, so I can’t vouch for their viability.
When import operations fail, it’s usually not immediately obvious… that’s one reason why they are tricky. You might think you got everything and then 3 months later you realize some critical link or bit of data is AWOL, so in a good import script, a significant portion is devoted to verifying the import.
The gotcha with the CCTM comes with “repeatable fields” — you can put yourself to sleep reading the longwinded discussion on it: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/CustomFieldsDataStructure but in a nutshell, the structure I opted for gets you paginated result-sets and optimized database queries, but it could poise unexpected hurdles for any 3rd party import tool. If your data does not use any “repeated fields”, then the task becomes much simpler and 3rd party tools become more viable. If that works for your project, then that’s great — it would represent the simplest and cheapest option. If not, then you can use the contact form above and the message should get to me.
Forum: Plugins
In reply to: [Custom Content Type Manager] Output filtersLinks to the end result are generally not useful in diagnosing PHP: it’s more helpful to see the PHP code that was used to generate the HTML.
Output filters are available only as a convenience, and there’s no requirement that you use them. I’m not sure how your SQL query looks, but the most “correct” solution (from a data-normalization standpoint), is to select the name as the visible option and the post ID as the stored value (because the ID never changes). Then the task is to convert the stored ID to whatever data it is you wish to display (e.g. the post_title, the permalink, the thumbnail etc). Once you’re sure you’re storing the post ID, then the crux of the problem is “how do I convert a post ID into the data represented by that post?” Variations on that question come up so often that I’ve devoted several of the FAQ’s to them: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/FAQ
Relatedly, a custom SQL query may not be necessary if you define your field as a relation field: it provides a GUI for you to specify criteria for searching the posts table specifically.
Hope that helps.
Forum: Plugins
In reply to: [Custom Content Type Manager] Mass import of data to custom fieldsAs a developer, I get asked to to quote this type of project about once every two weeks — I should have a canned response ready for this. In any application, however, importing/exporting is a tricky operation that is always more complicated than one would think, so I only get hired to actually write such a script about once per year (!). A 2-dimensional CSV or other flat-file is simply not a good vehicle for transporting multi-dimensional relational data from a database. Add references to external assets like images, and you’ve got yourself a complex and pricey project indeed.
Furthermore, the WP table architecture is poorly conceived for this type of usage in the first place — in other words, if your’e serious about efficiently storing your data, then there are better apps out there.
It’s possible I’ll write a tool like this for the pro version of the plugin, but it’s a tall order since nearly every case is unique (they all require custom tweaks), but for now, unfortunately, mass import is not possible.
Forum: Plugins
In reply to: [PHP Snippets] HTTP requests while using HTTPSThe url is set by the PHP_SNIPPETS_URL constant, which is predicated on the WP_PLUGIN_URL constant (set by WordPress). In other words, if WP returns an https url for its WP_PLUGIN_URL, then PHP_SNIPPETS_URL will follow suit. If you’re using a plugin to “force” SSL connections, then I suspect it’s too late in the event chain — instead the SSL connection should be forced at the web-server application layer (e.g. in your .htaccess file).
This represents a flagrant flaw in WordPress in my mind: WP is the only CMS application I know of that does not rely on configurable values for its path and URL settings and instead relies on some awkward workarounds to read the values. It makes migrating sites extremely difficult, and in your case, it causes some glitches like this.
Forum: Plugins
In reply to: [PHP Snippets] Snippets stopped workingCheck your PHP error logs. Standard WP debugging practice would include deactivating all other plugins to isolate the problem.
Did you recently upgrade WordPress or change hosts or update PHP or something?
Forum: Plugins
In reply to: [Custom Content Type Manager] [summarize-posts] PaginationaSetting limit=1 means that you only want 1 result. Is that what you really want? Pagination usually occurs when you have lots of results on one page, e.g. 10 on this page, 10 on the next page etc.
The docs on the shortcode are here: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/summarize_posts_shortcode
but the rules for pagination are unfortunately complicated.
Forum: Plugins
In reply to: [Custom Content Type Manager] SQL queries do not work properlyAlready addressed: https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=541
Will go out in the next version.
Forum: Plugins
In reply to: [Custom Content Type Manager] cctm save post with blank required field !Forum: Plugins
In reply to: [Custom Content Type Manager] Featured images – Different layoutNothing has changed with those forms/controls, it looks like you’re just on the wrong tab: the featured image is controlled via the “Fields” tab. Edit your post type definition and head to the “Fields” tab, then check “Page Attributes” and then you can check the box for “Thumbnail”.
From the wiki: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/CreatePostType#Page_Attributes
Forum: Plugins
In reply to: [Custom Content Type Manager] Upload error in CCTM media custom fieldThis is an issue that comes up repeatedly because WP’s integration of this bit of functionality is so myopic it hurts. The CCTM attempts to workaround this, but I can’t give you any useful information without knowing exactly how your fields are defined and exactly how you tried to upload the image (there are several options of each). See https://code.google.com/p/wordpress-custom-content-type-manager/wiki/ReportingBugs
I would recommend downloading and using the the development version of the plugin — I’ve done some work on this functionality recently so there’s a good chance the issue is resolved in the development code.
I’m not sure I understand what you’re asking… in WP there are 2 types of “widgets”:
1. Widgets for the front-end that show up when people visit your site. The CCTM has 2 types of widgets you can build: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/Widgets But remember: not every theme supports widgets and some only support a certain number of them.
2. “Metaboxes” are for the manager — they look a lot like widgets, but technically they are different. You define metaboxes when you add custom fields to your post type. See https://code.google.com/p/wordpress-custom-content-type-manager/wiki/MetaBoxes
Forum: Plugins
In reply to: [Custom Content Type Manager] cctm_post_form and post_statusI keep thinking about this one — I think probably the most “correct” and flexible behavior here would be to implement your own callback function (specified in the _callback argument). You can still have the CCTM to all of its normal stuff, e.g.
[cctm_post_form post_type="something" _callback="my_custom_handler"]Then in your theme’s functions.php (or in any included path):
/** * Custom callback function * * @param array $args: parameters from the shortcode and posted data * @return string (printed) */ function my_custom_handler($args) { // First, do the default behavior $out = CCTM::post_form_handler($args); // Generate the slug, modify the post-status, display a comment form // do something else return $out; }That would work even if the other parts of the function were changed in the CCTM core. I have done some improvements in this function for the next release.
See https://code.google.com/p/wordpress-custom-content-type-manager/wiki/cctm_post_form
Forum: Plugins
In reply to: [Custom Content Type Manager] dropdown field dosent memorized my 1st choiceThank you. It has been fixed: https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=543
One of the problems with WP’s default implementation of custom fields is that they are not standardized, so one post might have custom fields named A, B, C, and another post might have D, E, F, G, H, etc. and that makes it nearly impossible to have a sensible template for formatting those posts because one post might contain completely different data than another post. From an architectural standpoint, that’s a big problem.
Enter the CCTM: it can create custom post types, but for the built-in post types (e.g. posts and pages), it can standardize their custom fields. Go to the “Custom Content Types” menu and click on the “Standardize Custom Fields” link for either posts or pages (whichever you’re dealing with), then all the custom fields defined and associated with that post-type (see the “Manage Custom Fields” link) will be shown on every post or page.
See https://code.google.com/p/wordpress-custom-content-type-manager/wiki/FAQ