diff --git a/gulpfile.js b/gulpfile.js index 86bf1b87a4..6daaa1a820 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -411,6 +411,81 @@ ${ blockDesignSystem }); cb() } ) +gulp.task( 'generate-design-library-default-placeholders-php', function( cb ) { + const fs = require( 'fs' ) + + let defaultPlaceholders = 'array()' + + const toAssocArray = ( key, value, cb, indent ) => { + if ( typeof value === 'object' ) { + const parsed = cb( value, indent + 1 ) + return `"${ key }" => ${ parsed }` + } + + return `"${ key }" => "${ value }"` + } + + const parsePlaceholders = ( obj, indent ) => { + let content = '' + const tab = '\t'.repeat( indent ) + + if ( typeof obj === 'object' ) { + content += 'array(\n' + + Object.entries( obj ).forEach( ( [ key, value ], index, bds ) => { + content += tab + toAssocArray( key, value, parsePlaceholders, indent ) + + if ( index !== bds.length - 1 ) { + content += ',\n' + } else { + content += '\n' + } + } ) + content += `\t`.repeat( indent - 1 ) + ')' + } + return content + } + + const jsonPath = path.resolve( __dirname, `src/components/design-library-list/default.json` ) + if ( fs.existsSync( jsonPath ) ) { + const fileContent = fs.readFileSync( jsonPath, 'utf-8' ) + const raw = JSON.parse( fileContent ) + defaultPlaceholders = parsePlaceholders( raw, 4 ) + } + + // Generate PHP variable string + const script = ` +` + // Write PHP variable to file + fs.writeFileSync( path.resolve( __dirname, 'src/design-library/default-placeholders.php' ), script ) + + cb() +} ) + gulp.task( 'generate-translations-js', gulp.series( // The collect function has an issue where it will not continue if the // folder will it writes to doesn't exist, create it to prevent an error. @@ -703,7 +778,7 @@ gulp.task( 'style-deprecated', gulp.parallel( * END deprecated build styles, we still build these ********************************************************************/ -gulp.task( 'build-process', gulp.parallel( 'style', 'style-editor', 'welcome-styles', 'style-deprecated', 'generate-translations-js', 'generate-stk-block-typesphp' ) ) +gulp.task( 'build-process', gulp.parallel( 'style', 'style-editor', 'welcome-styles', 'style-deprecated', 'generate-translations-js', 'generate-stk-block-typesphp', 'generate-design-library-default-placeholders-php' ) ) gulp.task( 'build-block-design-system', gulp.parallel( 'generate-block-design-system-php', 'generate-block-design-system-scss' ) ) @@ -740,6 +815,11 @@ const watchFuncs = ( basePath = '.' ) => { [ `${ basePath }/src/block/**/block.json` ], gulp.parallel( [ 'generate-stk-block-typesphp' ] ) ) + + gulp.watch( + [ `${ basePath }/src/components/design-library-list/default.json` ], + gulp.parallel( [ 'generate-design-library-default-placeholders-php' ] ) + ) } gulp.task( 'watch', gulp.series( 'build-block-design-system', 'build-process', function watch( done ) { diff --git a/plugin.php b/plugin.php index ba528f0e54..d31a902c69 100644 --- a/plugin.php +++ b/plugin.php @@ -230,6 +230,7 @@ function is_frontend() { require_once( plugin_dir_path( __FILE__ ) . 'src/kses.php' ); require_once( plugin_dir_path( __FILE__ ) . 'src/dynamic-breakpoints.php' ); require_once( plugin_dir_path( __FILE__ ) . 'src/design-library/init.php' ); +require_once( plugin_dir_path( __FILE__ ) . 'src/design-library/default-placeholders.php' ); require_once( plugin_dir_path( __FILE__ ) . 'src/styles/block-design-system.php' ); require_once( plugin_dir_path( __FILE__ ) . 'src/plugins/theme-block-style-inheritance/index.php' ); require_once( plugin_dir_path( __FILE__ ) . 'src/global-settings.php' ); diff --git a/src/design-library/default-placeholders.php b/src/design-library/default-placeholders.php new file mode 100644 index 0000000000..7abc4fb6c1 --- /dev/null +++ b/src/design-library/default-placeholders.php @@ -0,0 +1,512 @@ + array( + "heading_placeholder" => "Transform Your Business Today", + "description_placeholder" => "Unlock your full potential with our cutting-edge solutions. We empower businesses of all sizes to achieve their goals through innovative technology and unparalleled support.", + "kicker_placeholder" => "Seize the Opportunity", + "btn-1_placeholder" => "Get Started Now", + "btn-2_placeholder" => "Learn More", + "item-1_placeholder" => "Streamline your operations and boost efficiency.", + "item-2_placeholder" => "Gain actionable insights with advanced analytics." + ), + "Card" => array( + "heading_placeholder" => "Unlock Your Full Potential", + "long-description_placeholder" => "At XYZ Company, we partner for your growth. Our solutions leverage cutting-edge technology, provide expert guidance, and ensure seamless integration for measurable results. We empower you with the tools and support to confidently navigate challenges, building your success on innovation and reliability.", + "description_placeholder" => "Discover how our comprehensive solutions empower your journey.", + "subtitle_placeholder" => "Your Path to Innovation and Growth", + "title_placeholder" => "Solutions Designed to Propel You Forward", + "c-btn_placeholder" => "Learn More", + "c-title-1_placeholder" => "Innovative Solutions", + "c-subtitle-1_placeholder" => "Cutting-Edge Technology", + "c-description-1_placeholder" => "Discover how our advanced solutions can revolutionize your approach, providing efficiency and unprecedented growth.", + "c-title-2_placeholder" => "Expert Guidance", + "c-subtitle-2_placeholder" => "Personalized Support", + "c-description-2_placeholder" => "Benefit from our team's extensive knowledge and receive tailored advice to meet your unique challenges.", + "c-title-3_placeholder" => "Seamless Integration", + "c-subtitle-3_placeholder" => "Effortless Setup", + "c-description-3_placeholder" => "Our products are designed for easy integration, ensuring a smooth transition and immediate productivity.", + "c-title-4_placeholder" => "Measurable Results", + "c-subtitle-4_placeholder" => "Data-Driven Outcomes", + "c-description-4_placeholder" => "Track your progress with comprehensive analytics and see the tangible impact of our services on your goals.", + "c-title-5_placeholder" => "Community & Support", + "c-subtitle-5_placeholder" => "Connect and Collaborate", + "c-description-5_placeholder" => "Join a thriving community of users and access dedicated support to help you every step of the way.", + "c-title-6_placeholder" => "Future-Proof Design", + "c-subtitle-6_placeholder" => "Scalable and Adaptable", + "c-description-6_placeholder" => "Invest in solutions built for tomorrow, with the flexibility to grow and evolve with your needs." + ), + "Carousel" => array( + "subheading_placeholder" => "Learn and Grow", + "heading_placeholder" => "Explore Our Featured Resources", + "description_placeholder" => "Get inspired, sharpen your skills, and stay ahead with curated content from our team and industry experts.", + "kicker_placeholder" => "Learn and Grow", + "btn_placeholder" => "View All Resources", + "title-1_placeholder" => "The Beginner's Guide to UX Design", + "text-1_placeholder" => "A friendly introduction to core UX principles and design thinking.", + "title-2_placeholder" => "Scaling Your App Without the Stress", + "text-2_placeholder" => "Best practices for growing your platform while keeping performance sharp.", + "title-3_placeholder" => "Building a Brand That Connects", + "text-3_placeholder" => "Learn how to craft a brand identity that resonates with real people.", + "title-4_placeholder" => "Marketing Trends You Can't Ignore", + "text-4_placeholder" => "Stay updated with actionable insights from today's digital landscape." + ), + "Contact" => array( + "heading_placeholder" => "Get in Touch With Us", + "kicker_placeholder" => "Contact Us", + "description_placeholder" => "Whether you have questions, need support, or want to explore opportunities—our team is just a message away.", + "btn_placeholder" => "Learn More", + "title-1_placeholder" => "Job Opportunities", + "text-1_placeholder" => "Join our growing team and help us build the future—one line of code at a time.", + "title-2_placeholder" => "Support", + "text-2_placeholder" => "Reach out to our friendly support team for quick assistance with any technical or service-related concerns.", + "title-3_placeholder" => "Sales", + "text-3_placeholder" => "Discuss your goals with our sales team and discover how our solutions can meet your business needs.", + "cta_placeholder" => "Contact Us" + ), + "FAQ" => array( + "heading_placeholder" => "Frequently Asked Questions (FAQs)", + "description_placeholder" => "Find answers to the most common questions about [Your Product/Service]. If you can't find what you're looking for here, please contact us.", + "kicker_placeholder" => "Quick Answers to Your Top Questions", + "question-1_placeholder" => "What features does your service offer?", + "answer-1_placeholder" => "Our service offers a comprehensive set of features designed to help you manage your tasks. Key features include Feature A, Feature B, and Feature C. You can find a full list and details on our Features Page.", + "question-2_placeholder" => "Is our Service integrated with other products?", + "answer-2_placeholder" => "Yes, our Service offers integrations with various popular products and services to streamline your workflow. We currently integrate with Product A, Product B, and Product C. You can find more information about our current integrations and how to set them up on our [Integrations Page Link]. We are continuously working on adding more integrations.", + "question-3_placeholder" => "What are the pricing options involved?", + "answer-3_placeholder" => "We offer several pricing options to suit different needs. You can view a detailed breakdown of our plans and features on our Pricing Page. We have a free tier, monthly subscriptions, and annual plans.", + "question-4_placeholder" => "What payment methods do you accept?", + "answer-4_placeholder" => "We accept various convenient payment methods, including major credit cards (Visa, MasterCard, American Express), and in some cases, bank transfers. You can select your preferred payment method during the checkout or subscription process.", + "question-5_placeholder" => "What is your cancellation/refund policy?", + "answer-5_placeholder" => "Our cancellation policy allows you to cancel your subscription at any time through your account settings. Regarding refunds, our policy is we offer a 30-day money-back guarantee. Please refer to our Terms of Service Page for complete details.", + "question-6_placeholder" => "What are your hours of operation?", + "answer-6_placeholder" => "Our standard hours of operation are Monday to Friday, 9:00 AM to 5:00 PM in Pacific Standard Time (PST).", + "question-7_placeholder" => "How can I contact customer support?", + "answer-7_placeholder" => "You can contact our customer support team through several channels: Submit a request via our Support Contact Form. Email us directly at support@email.com. Use our live chat feature available on our website during business hours. Our support hours are Monday-Friday, 9 AM - 5 PM Pacific Standard Time (PST).", + "question-8_placeholder" => "How can I provide feedback?", + "answer-8_placeholder" => "We highly value your feedback as it helps us improve. You can provide feedback through several methods: Use the feedback form on our website, or email your suggestions or comments to feedback@email.com. You can also participate in surveys. We review all feedback submitted." + ), + "Featured Product" => array( + "kicker_placeholder" => "Discover Innovation", + "product-name-1_placeholder" => "Smart Lamp", + "product-description-1_placeholder" => "An intelligent lamp that adapts to your mood and environment with customizable ambiance and smart home integration.", + "feature-1_placeholder" => "Adaptive Lighting", + "feature-description-1_placeholder" => "Adjusts brightness and color automatically.", + "feature-2_placeholder" => "Voice Control", + "feature-description-2_placeholder" => "Hands-free operation with smart assistants.", + "feature-3_placeholder" => "Personalized Scenes", + "feature-description-3_placeholder" => "Create and save custom lighting presets.", + "feature-4_placeholder" => "Energy Efficient", + "feature-description-4_placeholder" => "Low power consumption with LED technology.", + "feature-5_placeholder" => "Sleek Design", + "feature-description-5_placeholder" => "Modern aesthetic to complement any decor.", + "feature-6_placeholder" => "Smart Connectivity", + "feature-description-6_placeholder" => "Connects to Wi-Fi for remote control.", + "product-name-2_placeholder" => "Ergonomic Chair", + "product-description-2_placeholder" => "A chair designed for ultimate comfort and posture support, enhancing productivity.", + "product-name-3_placeholder" => "Portable Projector", + "product-description-3_placeholder" => "A compact and powerful projector for cinematic quality anywhere.", + "btn-1_placeholder" => "Buy now", + "btn-2_placeholder" => "Add to Favorites" + ), + "Footer" => array( + "heading_placeholder" => "Contact us", + "kicker_placeholder" => "Stay connected", + "company-description_placeholder" => "InnovateCo creates cutting-edge solutions for modern living.", + "company_placeholder" => "InnovateCo", + "tagline_placeholder" => "Innovation for a Better Tomorrow", + "cta_placeholder" => "Join our Community", + "cta-btn_placeholder" => "Sign up now", + "btn-1_placeholder" => "Subscribe", + "btn-2_placeholder" => "Watch Demo", + "menu-1_placeholder" => "Main", + "menu-2_placeholder" => "About", + "link-1_placeholder" => "Our Story", + "link-2_placeholder" => "Team", + "link-3_placeholder" => "Careers", + "menu-3_placeholder" => "Products", + "link-4_placeholder" => "Shop All", + "link-5_placeholder" => "Bestsellers", + "link-6_placeholder" => "New Releases", + "menu-4_placeholder" => "Blog", + "link-7_placeholder" => "Latest Articles", + "link-8_placeholder" => "Categories", + "link-9_placeholder" => "Archives", + "menu-5_placeholder" => "Support", + "link-10_placeholder" => "FAQs", + "link-11_placeholder" => "Contact Us", + "link-12_placeholder" => "Shipping & Returns" + ), + "Gallery" => array( + "heading_placeholder" => "Nature's Grand Canvas", + "description_placeholder" => "Explore breathtaking landscapes and the serene beauty of our planet. Each image unveils a unique story from the heart of nature.", + "kicker_placeholder" => "Earth's Masterpieces", + "btn_placeholder" => "Explore More", + "img-subtitle-1_placeholder" => "Dolomite Majesty", + "img-title-1_placeholder" => "Peaks of Tre Cime di Lavaredo", + "img-description-1_placeholder" => "Towering rock formations of the Dolomites, including the formidable Tre Cime di Lavaredo, emerge through a misty sky, showcasing raw geological power.", + "img-subtitle-2_placeholder" => "Alpine Valleys", + "img-title-2_placeholder" => "South Tyrol's Autumn Embrace", + "img-description-2_placeholder" => "A tranquil scene in South Tyrol, Italy, where golden larch trees dot verdant hillsides, backed by snow-dusted mountains under a soft light.", + "img-subtitle-3_placeholder" => "Winter Wonderland", + "img-title-3_placeholder" => "Phelps Lake Winter Reflection", + "img-description-3_placeholder" => "A serene winter landscape featuring Phelps Lake, perfectly mirroring snow-covered mountains and frost-dusted pine trees under a clear, crisp sky.", + "img-subtitle-4_placeholder" => "Twilight Glow", + "img-title-4_placeholder" => "Valley Lights at Dusk", + "img-description-4_placeholder" => "As twilight settles, a valley below glows with the golden lights of a town, nestled against dark, silhouetted mountains under a streaked sky.", + "img-subtitle-5_placeholder" => "Ethereal Forest", + "img-title-5_placeholder" => "Misty Woodland Pathways", + "img-description-5_placeholder" => "A hauntingly beautiful forest shrouded in mist, where tall, bare trees stand solemnly above a carpet of rust-colored ferns, creating a sense of deep mystery.", + "img-subtitle-6_placeholder" => "Autumn Slopes", + "img-title-6_placeholder" => "Golden Larches of the Alps", + "img-description-6_placeholder" => "A stunning view across a mountain valley where vibrant golden larch trees cascade down slopes, contrasting with darker evergreens and distant peaks.", + "img-subtitle-7_placeholder" => "Dolomite Grandeur", + "img-title-7_placeholder" => "Pale di San Martino's Fiery Peaks", + "img-description-7_placeholder" => "The dramatic, sun-kissed peaks of the Pale di San Martino in the Dolomites catch the warm light, revealing their rugged textures and imposing scale.", + "img-subtitle-8_placeholder" => "Reflective Waters", + "img-title-8_placeholder" => "Lago di Limides Mirror", + "img-description-8_placeholder" => "The still, clear waters of Lago di Limides flawlessly reflect the cloudy sky and distant, mist-shrouded Dolomites, framed by pine trees along the shore." + ), + "Header" => array( + "company_placeholder" => "InnovateCo", + "link-1_placeholder" => "About", + "link-2_placeholder" => "Products", + "link-3_placeholder" => "Blog", + "link-4_placeholder" => "Support", + "btn_placeholder" => "Login" + ), + "Hero" => array( + "heading_placeholder" => "Elevate Your Digital Future", + "long-description_placeholder" => "At XYZ Company, we don't just build products; we forge partnerships. Our dedicated team works tirelessly to understand your unique challenges, crafting tailored strategies for sustainable growth. From concept to execution, we ensure a seamless and transformative experience.", + "description_placeholder" => "Driving global business growth through innovative solutions and unparalleled expertise.", + "kicker_placeholder" => "Future-Ready Solutions", + "btn-1_placeholder" => "Get Started Today", + "btn-2_placeholder" => "Learn More", + "item-1_placeholder" => "Scalable Solutions", + "item-2_placeholder" => "Expert Guidance", + "item-3_placeholder" => "Proven Impact", + "metric-1_placeholder" => "10M", + "metric-label-1_placeholder" => "Users Engaged", + "metric-2_placeholder" => "250", + "metric-label-2_placeholder" => "Solutions", + "metric-3_placeholder" => "20", + "metric-label-3_placeholder" => "Years of Expertise" + ), + "List" => array( + "heading_placeholder" => "Solutions for Your Growth", + "long-description_placeholder" => "We offer tailored solutions designed to meet your unique needs, from initial consultation to ongoing support. Our team of experts is dedicated to delivering high-quality results and ensuring your satisfaction.", + "description_placeholder" => "Here's a glimpse into the comprehensive services we provide to help you succeed. ", + "kicker_placeholder" => "Our Offerings", + "btn_placeholder" => "Learn More", + "group-title-1_placeholder" => "Core Services", + "group-title-2_placeholder" => "Specialized Solutions", + "title-1_placeholder" => "Strategic Planning", + "item-1_placeholder" => "Develop a clear roadmap for your business with our expert strategic planning services.", + "title-2_placeholder" => "Market Research", + "item-2_placeholder" => "Gain valuable insights into your target audience and industry trends through our in-depth market research.", + "title-3_placeholder" => "Brand Development", + "item-3_placeholder" => "Build a strong and recognizable brand identity that resonates with your customers.", + "title-4_placeholder" => "Digital Marketing", + "item-4_placeholder" => "Expand your online reach and engage with your audience through our comprehensive digital marketing strategies.", + "title-5_placeholder" => "Financial Consulting", + "item-5_placeholder" => "Optimize your financial performance and make informed decisions with our expert financial guidance.", + "title-6_placeholder" => "Operational Efficiency", + "item-6_placeholder" => "Streamline your processes and boost productivity with our operational efficiency consulting." + ), + "Logo Farm" => array( + "heading_placeholder" => "Trusted by Industry Leaders", + "description_placeholder" => "We're proud to collaborate with a diverse range of companies that trust us to deliver exceptional results. Our partnerships are built on mutual success and shared innovation, driving progress across various sectors.", + "kicker_placeholder" => "Our Valued Partners", + "btn_placeholder" => "Learn More" + ), + "Maps" => array( + "heading_placeholder" => "Find us", + "description_placeholder" => "Our main office is conveniently located and easily accessible for all your inquiries.", + "location-1_placeholder" => "Main Office", + "location-2_placeholder" => "Downtown Location", + "location-3_placeholder" => "Headquarters Annex", + "location-4_placeholder" => "Northside Hub" + ), + "Media and Text" => array( + "long-subheading_placeholder" => "Revolutionizing how we interact with the world.", + "heading_placeholder" => "Future of Connectivity", + "long-description_placeholder" => "Discover seamless integration and enhanced experiences designed to elevate your daily life. Our innovations transcend traditional boundaries, creating a more interconnected and intuitive world for everyone.", + "description_placeholder" => "Explore groundbreaking advancements that are shaping tomorrow's digital landscape.", + "kicker_placeholder" => "Tech Spotlight", + "btn_placeholder" => "Learn More", + "title-1_placeholder" => "Seamless Integration", + "text-1_placeholder" => "Experience unparalleled ease as our technology effortlessly blends into your existing systems, enhancing productivity without disruption.", + "title-2_placeholder" => "Intuitive Design", + "text-2_placeholder" => "Crafted with the user in mind, our interfaces are simple, elegant, and exceptionally easy to navigate, ensuring a smooth experience for everyone.", + "title-3_placeholder" => "Robust Security", + "text-3_placeholder" => "Your data's safety is our top priority. Benefit from multi-layered security protocols and advanced encryption that keep your information protected around the clock.", + "title-4_placeholder" => "Scalable Solutions", + "text-4_placeholder" => "Whether you're a small startup or a large enterprise, our flexible solutions are designed to grow with your needs, adapting to future demands seamlessly.", + "title-5_placeholder" => "Global Reach", + "text-5_placeholder" => "Connect with confidence. Our services extend worldwide, providing reliable and high-performance access no matter where you are.", + "title-6_placeholder" => "Dedicated Support", + "text-6_placeholder" => "Our expert team is always ready to assist you. Enjoy comprehensive support and resources designed to ensure your success." + ), + "Post Loop" => array( + "heading_placeholder" => "Our Latest Insights", + "post-btn_placeholder" => "Read more", + "btn_placeholder" => "View all", + "tag_placeholder" => "Editor's Picks", + "posts_placeholder" => array( + "0" => array( + "title_placeholder" => "Future of AI in Everyday Life", + "text_placeholder" => "Explore how AI is transforming daily routines and what's next." + ), + "1" => array( + "title_placeholder" => "Sustainable Living", + "text_placeholder" => "Discover easy ways to adopt eco-friendly habits." + ), + "2" => array( + "title_placeholder" => "Mastering Remote Work: Tips for Productivity", + "text_placeholder" => "Boost your efficiency with these essential remote work strategies." + ), + "3" => array( + "title_placeholder" => "Rise of Wearable Technology", + "text_placeholder" => "Learn about the latest advancements in wearable devices." + ), + "4" => array( + "title_placeholder" => "Cybersecurity Essentials", + "text_placeholder" => "Protect your digital life with these crucial security tips." + ), + "5" => array( + "title_placeholder" => "Mindful Photography", + "text_placeholder" => "Enhance your photography skills through a mindful approach." + ), + "6" => array( + "title_placeholder" => "Storytelling in Brand Building", + "text_placeholder" => "Learn how compelling narratives can elevate your brand." + ) + ) + ), + "Pricing Table" => array( + "heading_placeholder" => "Our Pricing Plans", + "description_placeholder" => "Choose the perfect plan to fit your needs, from individuals to large organizations. All plans include dedicated support and a commitment to your success.", + "btn-1_placeholder" => "Get Started", + "btn-2_placeholder" => "Buy Now", + "tag_placeholder" => "Best Value", + "title-1_placeholder" => "Flexible Scaling", + "text-1_placeholder" => "Easily upgrade or downgrade as your needs evolve.", + "title-2_placeholder" => "24/7 Customer Support", + "text-2_placeholder" => "Our team is always ready to assist you.", + "title-3_placeholder" => "Secure and Reliable Platform", + "text-3_placeholder" => "We prioritize your data's security and stability.", + "title-4_placeholder" => "Regular Feature Updates", + "text-4_placeholder" => "Benefit from continuous improvements and new functionalities.", + "plan-1_placeholder" => "Free", + "plan-description-1_placeholder" => "Perfect for individuals.", + "plan-1-item-1_placeholder" => "Limited Storage (e.g., 500MB)", + "plan-1-item-2_placeholder" => "Basic Analytics", + "plan-1-item-3_placeholder" => "Email Support", + "plan-1-item-4_placeholder" => "1 User Account", + "plan-2_placeholder" => "Basic", + "plan-description-2_placeholder" => "Ideal for small teams.", + "plan-2-item-1_placeholder" => "2GB Storage", + "plan-2-item-2_placeholder" => "Standard Analytics", + "plan-2-item-3_placeholder" => "Priority Email Support", + "plan-2-item-4_placeholder" => "Up to 3 User Accounts", + "plan-3_placeholder" => "Pro", + "plan-description-3_placeholder" => "Great for growing businesses.", + "plan-3-item-1_placeholder" => "10GB Storage", + "plan-3-item-2_placeholder" => "Advanced Analytics", + "plan-3-item-3_placeholder" => "Chat & Phone Support", + "plan-3-item-4_placeholder" => "Up to 10 User Accounts", + "plan-4_placeholder" => "Premium", + "plan-description-4_placeholder" => "Designed for established businesses.", + "plan-4-item-1_placeholder" => "Unlimited Storage", + "plan-4-item-2_placeholder" => "Real-time Advanced Analytics", + "plan-4-item-3_placeholder" => "Dedicated Account Manager", + "plan-4-item-4_placeholder" => "Unlimited User Accounts", + "plan-5_placeholder" => "Enterprise", + "plan-description-5_placeholder" => "Tailored for large organizations with unique demands.", + "plan-5-details_placeholder" => "For customized solutions including specialized features, dedicated infrastructure, and personalized support, please contact us to discuss an Enterprise plan." + ), + "Quote" => array( + "text-1_placeholder" => "The journey of a thousand miles begins with a single step.", + "name-1_placeholder" => "A. B. Johnson", + "position-1_placeholder" => "Thought Leader", + "text-2_placeholder" => "Innovation distinguishes between a leader and a follower.", + "name-2_placeholder" => "C. D. Williams", + "position-2_placeholder" => "Forward Thinker" + ), + "Service Menu" => array( + "heading_placeholder" => "Our Signature Menu", + "description_placeholder" => "Crafted with fresh ingredients and bold flavors—perfect for any time of day.", + "category-1_placeholder" => "Customer Favorites", + "category-2_placeholder" => "Brunch & Bowls", + "category-3_placeholder" => "Add-ons & Sides", + "title-1_placeholder" => "Grilled Herb Chicken", + "text-1_placeholder" => "Tender chicken breast marinated in herbs, served with charred vegetables.", + "title-2_placeholder" => "Smoked Salmon Bowl", + "text-2_placeholder" => "Cured salmon, quinoa, avocado, and lemon-dill dressing in one refreshing bowl.", + "title-3_placeholder" => "Creamy Mushroom Pasta", + "text-3_placeholder" => "Fresh pasta tossed in a garlic parmesan cream with sautéed mushrooms.", + "title-4_placeholder" => "Avocado Toast Stack", + "text-4_placeholder" => "Crispy sourdough topped with smashed avocado, egg, and house seasoning.", + "title-5_placeholder" => "Spiced Beef Rice Bowl", + "text-5_placeholder" => "Slow-braised beef, jasmine rice, and tangy slaw with a touch of heat.", + "title-6_placeholder" => "Breakfast Burrito", + "text-6_placeholder" => "Fluffy eggs, chorizo, potatoes, and cheese wrapped in a warm tortilla." + ), + "Stats" => array( + "heading_placeholder" => "Trusted by Teams, Loved by Customers", + "description_placeholder" => "Our impact speaks for itself—from satisfied clients to successful projects delivered across industries.", + "kicker_placeholder" => "By the Numbers", + "btn_placeholder" => "See Our Impact", + "stat-title-1_placeholder" => "Active Users", + "stat-title-2_placeholder" => "Installs", + "stat-title-3_placeholder" => "Websites", + "stat-title-4_placeholder" => "New Users" + ), + "Table of Contents" => array( + "heading_placeholder" => "Table of Contents", + "subtitle-1_placeholder" => "Setting Up Your Account", + "subtitle-2_placeholder" => "Navigating the Interface", + "subtitle-3_placeholder" => "Personalizing Your Profile", + "subtitle-4_placeholder" => "Discovering New Tools", + "subtitle-5_placeholder" => "Customizing Your Workspace", + "subtitle-6_placeholder" => "Collaborating with Others", + "subtitle-7_placeholder" => "Maximizing Productivity", + "subtitle-8_placeholder" => "Saving Time with Shortcuts", + "title-1_placeholder" => "Getting Started", + "title-2_placeholder" => "Exploring Features", + "title-3_placeholder" => "Tips and Tricks", + "title-4_placeholder" => "Our Community", + "title-5_placeholder" => "Frequently Asked Questions", + "title-6_placeholder" => "Glossary of Terms" + ), + "Tabs" => array( + "tab-1_placeholder" => "All", + "tab-2_placeholder" => "News", + "tab-3_placeholder" => "Trending", + "tab-4_placeholder" => "For You", + "tab-5_placeholder" => "Favorites", + "title-1_placeholder" => "Our Vision for the Future", + "text-1_placeholder" => "We envision a world where innovation drives progress, and technology empowers individuals. Our commitment lies in fostering solutions that are not only groundbreaking but also accessible and sustainable, contributing to a brighter tomorrow for everyone.", + "title-2_placeholder" => "Unlocking Your Potential", + "text-2_placeholder" => "Discover the tools and resources designed to help you achieve your goals. We believe in providing comprehensive support and personalized guidance, enabling you to navigate challenges and seize opportunities with confidence." + ), + "Team Members" => array( + "heading_placeholder" => "Meet Our Team", + "description_placeholder" => "We're a passionate group dedicated to innovation and excellence. Get to know the individuals who drive our success.", + "name-1_placeholder" => "Eleanor Vance", + "position-1_placeholder" => "CEO", + "text-1_placeholder" => "leads our vision and strategy, guiding the company toward new horizons", + "name-2_placeholder" => "Marcus Thorne", + "position-2_placeholder" => "Chief Technology Officer", + "text-2_placeholder" => "oversees all technological advancements and product development", + "name-3_placeholder" => "Sophia Chen", + "position-3_placeholder" => "Head of Marketing", + "text-3_placeholder" => "crafts our brand story and connects us with our audience", + "name-4_placeholder" => "David Miller", + "position-4_placeholder" => "Lead Product Designer", + "text-4_placeholder" => "responsible for the intuitive and user-friendly design of our products", + "name-5_placeholder" => "Alexander Gray", + "position-5_placeholder" => "Director of Operations", + "text-5_placeholder" => "ensures our daily operations run smoothly and efficiently", + "name-6_placeholder" => "Samuel Green", + "position-6_placeholder" => "Senior Software Engineer", + "text-6_placeholder" => " a key architect behind our robust software solutions" + ), + "Text" => array( + "heading_placeholder" => "Innovating for a Sustainable Future", + "long-subtitle_placeholder" => "Pioneering Global Solutions for a Greener Tomorrow's Challenges", + "long-description-1_placeholder" => "We invest in cutting-edge research to create tangible solutions for environmental challenges, integrating sustainable practices across our operations. Our holistic approach aims for long-term benefits for the planet and its inhabitants. True innovation stems from understanding ecological principles and technological advancement.", + "long-description-2_placeholder" => "By fostering collaborations globally, we build a robust framework for environmental stewardship. Our efforts empower communities to embrace sustainability and thrive in harmony with nature. This ensures solutions are groundbreaking, scalable, and adaptable.", + "description_placeholder" => "We are dedicated to creating a sustainable future through innovative solutions and responsible practices.", + "kicker_placeholder" => "Driving Global Change", + "btn_placeholder" => "Learn More", + "title-1_placeholder" => "Renewable Energy", + "text-1_placeholder" => "Developing advanced solar, wind, and hydro technologies to reduce reliance on fossil fuels.", + "title-2_placeholder" => "Circular Economy", + "text-2_placeholder" => "Implementing waste reduction, resource recovery, and product lifecycle optimization strategies.", + "title-3_placeholder" => "Sustainable Agriculture", + "text-3_placeholder" => "Promoting eco-friendly farming methods and resilient food systems.", + "title-4_placeholder" => "Biodiversity Conservation", + "text-4_placeholder" => "Protecting habitats, supporting endangered species, and promoting ecological balance.", + "title-5_placeholder" => "Smart Cities", + "text-5_placeholder" => "Designing urban environments with green spaces and efficient infrastructure.", + "title-6_placeholder" => "Environmental Education", + "text-6_placeholder" => "Empowering communities with knowledge to adopt sustainable lifestyles." + ), + "Testimonials" => array( + "heading_placeholder" => "What Our Clients Say", + "description_placeholder" => "Here's a look at what people are saying about working with us. We're proud to have helped so many achieve their goals.", + "kicker_placeholder" => "Testimonials", + "name-1_placeholder" => "Emily Johnson", + "position-1_placeholder" => "Marketing Manager", + "text-1_placeholder" => "XYZ Company has been a game-changer. Our online engagement and conversions significantly increased, leading to a 30% rise in leads in three months!", + "name-2_placeholder" => "David Smith", + "position-2_placeholder" => "Small Business Owner", + "text-2_placeholder" => "Struggling to grow online, XYZ Company provided the perfect solution. Their tailored approach made a huge difference; my sales have doubled.", + "name-3_placeholder" => "Sophia Miller", + "position-3_placeholder" => "E-commerce Specialist", + "text-3_placeholder" => "XYZ Company transformed our platform. Their expertise boosted traffic and improved satisfaction, consistently giving us higher average order values.", + "name-4_placeholder" => "William Brown", + "position-4_placeholder" => "Tech Startup Founder", + "text-4_placeholder" => "XYZ Company delivered exceptional value. They helped us develop a strong brand and launch our product effectively. We've gained valuable traction.", + "name-5_placeholder" => "James Wilson", + "position-5_placeholder" => "Non-profit Director", + "text-5_placeholder" => "XYZ Company exceeded our expectations. Their dedication significantly increased our donations and volunteer sign-ups by improving our online presence.", + "name-6_placeholder" => "Olivia Davis", + "position-6_placeholder" => "Real Estate Broker", + "text-6_placeholder" => "XYZ Company gave me the edge. Their innovative digital advertising brought consistent, qualified leads, directly leading to more property sales." + ), + "Timeline" => array( + "heading_placeholder" => "Our Journey Through Time", + "kicker_placeholder" => "A Legacy of Progress", + "description_placeholder" => "Explore the key milestones that have shaped our story, from our humble beginnings to our latest achievements.", + "btn_placeholder" => "Discover more", + "title-1_placeholder" => "Founding Vision", + "text-1_placeholder" => "Our journey began with a bold idea to revolutionize the industry.", + "title-2_placeholder" => "First Product Launch", + "text-2_placeholder" => "We introduced our inaugural product to critical acclaim.", + "title-3_placeholder" => "Global Expansion", + "text-3_placeholder" => "Our reach extended to new international markets.", + "title-4_placeholder" => "Innovation Award Received", + "text-4_placeholder" => "Recognized for our groundbreaking technological advancements.", + "title-5_placeholder" => "Community Initiative Launched", + "text-5_placeholder" => "A new program dedicated to giving back to society.", + "title-6_placeholder" => "Future Forward Summit", + "text-6_placeholder" => "Hosting an event to discuss the next era of innovation." + ), + "Videos" => array( + "heading_placeholder" => "Our Story", + "kicker_placeholder" => "See Us in Action", + "description_placeholder" => "Dive deep into the heart of InnovateCo, exploring our origins, values, and the future we're building.", + "btn-1_placeholder" => "Watch Later", + "btn-2_placeholder" => "Find Related Videos", + "title-1_placeholder" => "Our Story", + "title-2_placeholder" => "Lamp Features", + "title-3_placeholder" => "Behind the Scenes", + "title-4_placeholder" => "Customer Success", + "title-5_placeholder" => "Expert Interview", + "title-6_placeholder" => "Sustainability Efforts", + "title-7_placeholder" => "Future Innovations" + ) + ); + + return $default_placeholders; + } + } + + new Stackable_Design_Library_Placeholders(); +} +?> diff --git a/src/design-library/init.php b/src/design-library/init.php index 9ab1f70d6d..b2701dffb8 100644 --- a/src/design-library/init.php +++ b/src/design-library/init.php @@ -423,6 +423,27 @@ public function get_category_kebab_case( $category ) { return preg_replace( '/[^a-z0-9-]+/', '-', $category ); } + public function get_template_with_placeholders( $template, $category ) { + if ( ! class_exists( 'Stackable_Design_Library_Placeholders' ) ) { + return $template; + } + + $default_placeholders = Stackable_Design_Library_Placeholders::get_default(); + + if ( ! isset( $default_placeholders[ $category ] ) ) { + return $template; + } + + foreach( $default_placeholders[ $category ] as $placeholder => $value ) { + if ( ! is_string( $value ) ) { + continue; + } + $template = str_replace( $placeholder, $value, $template ); + } + + return $template; + } + public function register_design_pattern() { $designs = $this->get_design_library_from_cloud(); @@ -462,7 +483,7 @@ public function register_design_pattern() { 'stackable/' . $design_id, array( 'title' => sprintf( __( 'Stackable %s', STACKABLE_I18N ), $design[ 'label' ] ), - 'content' => $design[ 'template' ], + 'content' => $this->get_template_with_placeholders( $design[ 'template' ], $design[ 'category' ] ), 'categories' => array( 'stackable/' . $this->get_category_kebab_case( $design[ 'category' ] ), 'stackable' ), // used in Patterns 'category' => $design[ 'category' ], // used in Design Library 'description' => $design[ 'description' ],