Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPT support + custom TinyMCE locations #67

Open
5 tasks
khromov opened this issue Sep 22, 2015 · 6 comments
Open
5 tasks

CPT support + custom TinyMCE locations #67

khromov opened this issue Sep 22, 2015 · 6 comments

Comments

@khromov
Copy link
Collaborator

khromov commented Sep 22, 2015

As per:
https://wordpress.org/support/topic/script-not-loading-with-acf-wysiwyg-editor?replies=1#post-7454794

  • Make sure Content Cards work with custom post types.
  • See if we can support the most common use cases of TinyMCE outside the post editor:
    • In ACF (on posts)
    • In ACF (on settings pages)
    • In the Black Studio TinyMCE Widget plugin
@ideag
Copy link
Owner

ideag commented Sep 22, 2015

yeah, I am looking into that, too.

As for CPT, Content Cards should already work in all of them. The problem is when wp_editor is loaded in unusual places (settings, tools, etc.) as now we load most of javascript only on post pages in WP Admin, due to this check:

    if ( ! isset( get_current_screen()->id ) || get_current_screen()->base != 'post' ) {
        return;
    }

We need a better check if wp_editor() is being loaded.

@ideag ideag modified the milestones: 0.9.4, 1.0.0 Sep 22, 2015
@ideag
Copy link
Owner

ideag commented Sep 22, 2015

I think I have a solution for this. Instead of using admin_enqueue_scripts hook, we should use wp_enqueue_editor hook to enqueue content-cards.js.This way it would be loaded every time wp_editor is loaded, even on front end. I'll implement and test it out later today.

@khromov
Copy link
Collaborator Author

khromov commented Sep 22, 2015

Sounds awesome 👍

@ideag
Copy link
Owner

ideag commented Sep 22, 2015

But I see a different problem - if we use this not in a post context, there is no post_id to use for data cache'ing

@khromov
Copy link
Collaborator Author

khromov commented Sep 22, 2015

@ideag Options table for storage perhaps? Wouldn't that also make it possible to share cache if multiple pages embed the same URL?

@ideag
Copy link
Owner

ideag commented Sep 22, 2015

@khromov hmm, I discarded idea of storage in optionsearly on, and chose postmeta because postmeta has internal gabage collection (gets deleted when the post gets deleted). And because of possibility that the same url is used on several posts, gabage collection would be tricky in options table.

This was referenced Jan 6, 2017
@ideag ideag modified the milestones: 0.9.6, 1.0.0 Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants